| Home >> All >> com >> newsfighter >> [ mvc Javadoc ] |
Source code: com/newsfighter/mvc/TestAction.java
1 package com.newsfighter.mvc; 2 3 4 import java.io.IOException; 5 import java.util.Hashtable; 6 import java.util.Locale; 7 import javax.servlet.RequestDispatcher; 8 import javax.servlet.ServletException; 9 import javax.servlet.http.HttpServletRequest; 10 import javax.servlet.http.HttpSession; 11 import javax.servlet.http.HttpServletResponse; 12 import org.apache.struts.action.Action; 13 import org.apache.struts.action.ActionError; 14 import org.apache.struts.action.ActionErrors; 15 import org.apache.struts.action.ActionForm; 16 import org.apache.struts.action.ActionForward; 17 import org.apache.struts.action.ActionMapping; 18 import org.apache.struts.action.ActionServlet; 19 import org.apache.struts.util.MessageResources; 20 21 22 public final class TestAction extends Action { 23 24 25 // --------------------------------------------------------- Public Methods 26 27 /** 28 * Process the specified HTTP request, and create the corresponding HTTP 29 * response (or forward to another web component that will create it). 30 * Return an <code>ActionForward</code> instance describing where and how 31 * control should be forwarded, or <code>null</code> if the response has 32 * already been completed. 33 * 34 * @param mapping The ActionMapping used to select this instance 35 * @param actionForm The optional ActionForm bean for this request (if any) 36 * @param request The HTTP request we are processing 37 * @param response The HTTP response we are creating 38 * 39 * @exception IOException if an input/output error occurs 40 * @exception ServletException if a servlet exception occurs 41 */ 42 public ActionForward perform(ActionMapping mapping, 43 ActionForm form, 44 HttpServletRequest request, 45 HttpServletResponse response) 46 throws IOException, ServletException { 47 48 // Do nothing. This is only a test. 49 50 // Forward control to the specified success URI 51 if (servlet.getDebug() >= 1) { 52 servlet.log(" Forwarding to home page"); 53 } 54 return (mapping.findForward("home")); 55 } 56 } 57 58