Interview Question: Write code of any Action Class?

By: Ash Printer Friendly Format    


Question:Write code of any Action Class?

Answer:

Here is the code of Action Class that returns the ActionForward object.
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class TestAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{
return mapping.findForward(\"testAction\");
}
}

 

 

 

 


Most Viewed Articles (in Interview )

Interview Question: Is there a particularly good IDE to use with Struts ?

Interview Question: What is the difference between find and select methods in EJB?

Interview Question: Who makes the Struts?

Interview Question: Why it is called Struts?

Interview Question: What is Action Class?

Interview Question: What is Struts Validator Framework?

Interview Question: What is ActionForm?

Interview Question: Do you have to credit Struts on your own website?

Interview Question: What is ActionServlet?

Interview Question: What about JSTL and JavaServer Faces ?

Interview Question: Why are some of the class and element names counter-intuitive?

Interview Question: What is EJB client JAR file?

Interview Question: What is Local client view in EJB?

Interview Question: What is difference between EJB 1.1 and EJB 2.0?

Interview Question: Is Decorator an EJB design pattern?

Latest Articles (in Interview)

Comment on this tutorial