hi,I am going through the struts-example comes with the
struts package.I have some question about the mainMenu.jsp and EditRegistrationAction.java:
1.In the mainMenu.jsp,the action class is trigerred by <html:link page="/editRegistration.do?action=Edit">.And we can found that in the structs-config.xml,there is a action mapping as follows:
<action path="/editRegistration"
type="org.apache.struts.webapp.example.EditRegistrationAction"
name="registrationForm"
scope="request"
validate="false">
<forward name="success" path="/registration.jsp"/>
</action>
I understand that When the ActionServlet received the request from mainMenu.jsp,it will first create an instance of registrationForm if it's not exits yet.And then try to update the fields in it if there is a attribute with the same name from the request.In this case,I think only the action fields in the FormBean will be updated,and the form parameter in the EditRegistrationAction class won't be null,right?
2.in the EditRegistrationAction.java,before setting the value of the formbean,there is a statement:
RegistrationForm regform = (RegistrationForm) form;
what's the use of it?why not use the variable form directly?