Hai all.Can i develope Struts action class without execute(-,-
,-,-)method.Ifd it's possible plz provide some sample code.

Answers were Sorted based on User's Feedback



Hai all.Can i develope Struts action class without execute(-,- ,-,-)method.Ifd it's possible p..

Answer / sreekanth madamanchi

If your Action class extends from Dyna Action Action, then
you can develop struts action class with out execute
method. Because in that action class we write our own
methods insted of execute method.

EXAMPLE:
public class Dispatch_Action extends DispatchAction
{

public ActionForward add(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{
System.out.println("You are in add function.");
return mapping.findForward("add");
}

public ActionForward delete(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception
{
System.out.println("You are in delete function.");
return mapping.findForward("delete");
}
public ActionForward search(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{
System.out.println("You are in search function");
return mapping.findForward("search");
}
public ActionForward save(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception{
System.out.println("You are in save function");
return mapping.findForward("save");

}
}

Is This Answer Correct ?    20 Yes 3 No

Hai all.Can i develope Struts action class without execute(-,- ,-,-)method.Ifd it's possible p..

Answer / shashi

Yes , we have just use the Dispatch Action class for ignore the execute method.

Is This Answer Correct ?    16 Yes 1 No

Hai all.Can i develope Struts action class without execute(-,- ,-,-)method.Ifd it's possible p..

Answer / naman patidar

I want to add some points reply of Sreekanth Madamanchi.
1. DynaAction class should be used only when you are having
more then one action on you form.
2. JSP must have same action name as of method in the action
class

Is This Answer Correct ?    11 Yes 0 No

Post New Answer

More Struts Interview Questions

What is action class?

0 Answers  


struts 1.3 features?

1 Answers   Integra, Zensar,


what are the type of forward class in Struts?

5 Answers   Wipro,


Is struts 1 still supported?

0 Answers  


What is actioninvocation in struts2?

0 Answers  






What are action errors?

0 Answers  


session menagement in servlets explaion briefly?

1 Answers  


Hi i am murali.i need a excellent answer for the question Tell me about project and project flow ? i mean it is use full to any project,it is on STRUTS

2 Answers  


what is the diff between struts1.0 and struts2.0

2 Answers   Intel,


What are the various struts tag libraries?

0 Answers  


drawback of Validation Framework where and how to write the connection pool object in the programe how to debug the programe and application in struts without using eclips

1 Answers  


What are different ways to create Action classes in Struts2?

0 Answers  


Categories