Hi, I just try to upgrade my project from struts 2.1.6 to struts 2.1.8, I found that some property is not working. For example, property username in Login.class working while sUsername is not working. Lets do a simple test on struts2 blank project in struts2.1.8.zip
1. unzip struts2-blank-2.1.8.war. 2. add the following code at Login.jsp <s:textfield key="username"/> <s:textfield name="sUsername" label="sUsername"/> <s:password key="password" /> 3. add the following code at Login-validation.xml. <validators> ...... <field name="sUsername"> <field-validator type="requiredstring"> <message key="requiredstring" /> </field-validator> </field> ....... </validators> 4. add the following code at Login.java. private String sUsername; public String getsUsername() { return sUsername; } public void setsUsername(String sUsername) { System.out.println("testing only"); this.sUsername = sUsername; } 5. running tomcat, type http://localhost:8080/struts2-blank/example/Login.action Test 1 ======= 1. fill in all fields in the form and click submit button. 2. type admin for Username. 3. type admin2 for sUsername. 4. type 123456 for password. Result 1. unable to login because screen showing message 'This Field is required' for sUsername. 2. the text input value for sUsername is blank but the text input value for Username is 'admin'. Test 2 ======= 1. remove the sUsername validation at Login-validation.xml. 2. type http://localhost:8080/struts2-blank/example/Login.action 3. fill in all fields in the form and click submit button. Result unable to see 'testing only' at console. (meaning setter for sUsername not called). Thanks. -- Best Regard, Kam Hon --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org