In recent days, many friends started to study Struts brought examples and have a lot of problems. I also returned a lot of posts, but the amount of question was not reduced, so I decided to write a presentation. It is not very detailed, mainly for each problem point for the post.
JSP screen
Registration.jsp
Registration.jsp is used by client checks.
Form:
οnsubmit = "Return ValidateRegistrationform (this);"> The rear of the code is: DynamicjavaScript = "true" StaticjavaScript = "false" /> The ValidateRegistrationForm (this) in the form tag is corresponding to the value of the FormName (Registrationform). The FormName RegistrationForm must match the form name in Struts-Config.xml and Validation.xml files. The Type of the Registrationform can be seen in Struts-Config.xml is Org.Apache.Struts.validator.DynavalidatorForm. DynavalidatorForm is an From class of Struts, you only need to define the Form-property in struts-config.xml. Validation.xml Configuring the appropriate check requirements, the verification rules are defined in Validator-Rules.xml. Several valids for Registrationform are self-contained, and we can also define themselves (if you have time in the future, I plan to say this). HTML: DynamicJavaScript = "true" staticjavascript = "false" in JavaScript It is a dynamic JavaScript script that does not implement a static JavaScript script. Then introduced StaticJavaScript.jsp, there is this JSP screen. Recover the parameters, do not implement dynamic JavaScript scripts, implement static JavaScript scripts. to be continued Related Links: Struts comes with an example of an example (2) http://www.9cbs.net/develop/read_article.asp?id=26048