Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When do I need “struts.jar” on my classpath?

975


What is the purpose of @result annotation?

1154


What are interceptors in struts 2?

1017


What are action errors and error and what are the consequences they impose?

1008


What are the struts2 error message keys that can come during file uploading process?

1072


Does Struts2 action and interceptors are thread safe?

1086


Can we have multiple struts config files in a single web app?

944


What does action do in struts?

1006


What is struts2 namespace?

924


What are the steps of struts installation?

1008


1.can we transfer a request from one struts application to another struts application? 2. how many types of action servlets r there what r they

3194


Can you explain struts.properties in struts2?

954


Give an alternative way to protect jsp’s with not much features from direct access.

1006


Explain about the library tag?

989


Are the struts tags xhtml compliant ?

939