Programming Tutorials

Interview Question: Write code of any Action Class?

By: Ash in Interview Tutorials on 2008-08-13  

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");
    }
}





Add Comment

* Required information
1000

Comments

No comments yet. Be the first!

Most Viewed Articles (in Interview )

What is JSP Scriptlet?

Interview Question: Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?

Tell me something about J2EE component?

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

What are implicit Objects available to the JSP Page?

Interview Question: How does Struts work?

Differentiate between .ear, .jar and .war files.

What is the difference between interface and abstract class?

Explain the user defined Exceptions?

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

The output of System.out.println(5>>2) in Java

Types of Interviews

Explain garbage collection?

Question: What is a Hidden Comment in JSP?

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

Latest Articles (in Interview)