If above is your struts-config.xml file structure and LoginAction extendsDispatchAction instead of normal Action class. And assuming [keep assuming] yourLoginAction class havemethod named authenticateUser, then in your login.jsp addany hidden parameter called task with value as your method name and on submit of that page following will be the url:http://localhost:8080/yourproject/jsp/login.jsp?login.do&task=authenticateUser Thus if we try to combine the last part of thispuzzlewe get the climax at struts-config.xml file's action-mappingtagdescribed above. The parameter property of <action> tag have the task as it's value pointing to taskvariable in the request having it's value as authenticateUserhence the framework search in the LoginAction a method called authenticateUserthrough reflection and forwards the execution flow to it. This is all folks, the briallancy of Struts framework.Note DispatchAction class is included in 1.1 version.
1) A request is made from previously displayed view.2) The request reaches the ActionServlet which acts as the controller .TheActionServlet Looksup the requested URI in an XML file (Struts-Config.xml) anddetermines the name of theAction classthat has to perform the requested business
logic.3) The Action Class performs its logic on the Model Components associated with theApplication.4) Once the Action has been completed its processing it returns the control to theAction Servlet. As part of its return the Action Class provides a key to determinewhere the results should be forwarded for presentation.5) The request iscompletewhen the Action Servlet responds by forwarding therequest to the view, and this view represents the result of the action.
How to call EJB from Struts?
We can call EJB from Struts by using service locater design pattern or by using initialcontext with create home object and getting return remote reference object.
What is the difference between bean:write and bean:message?
These two are custom tags HTML tag library. Both these two are used to call the java bean.bean:message - is to access a java bean that will display a message such as " Formore details on the product displayed in this web site please contact a phonenumber 12345.."