1 import java.io.*; 2 import javax.servlet.*; 3 import javax.servlet.http.*; 4 5 import jodd.servlet.*; 6 7 public class FooAction extends ActionServlet { 8 9 19 public void doRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 20 System.out.println("---------------------"); 21 System.out.println("FooAction.doRequest()"); 22 23 String s = invokeAction(request, response); 25 System.out.println("invoking result: " + s); 26 if (s != null) { 27 return; } 29 30 if (forwardParam(request, response)) return; 33 if (redirectParam(request, response)) return; 34 35 System.out.println("nothing to do, just go back..."); 38 redirect(request, response, "index.html"); 39 } 40 41 56 public boolean one(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 57 System.out.println(">ACTION #1"); 58 return true; 59 } 60 61 public boolean two(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 62 System.out.println(">ACTION #2, redirect"); 63 redirectParam(request, response); 64 return true; 65 } 66 67 public boolean three(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 68 System.out.println(">ACTION #3, forward"); 69 forwardParam(request, response); 70 return true; 71 } 72 73 74 } 75 76
| Popular Tags
|