struts2为什么不显示username,其他的可以正常显示,但username这个有时不能正常显示。代码如下:
1.register.jsp <body>
    <s:fielderror></s:fielderror>
    <form action="register" method="post">
    <table align="center" width="40%" border="1">
    <tr>
    <td>username</td>
    <td><input name="username" type="text" value="${requestScope.username}"></td>
    </tr>
    <tr>
    <td>password</td>
    <td><input name="password" type="password"></td>
    </tr>  
    <tr>
    <td>re-password</td>
    <td><input name="repassword" type="password"></td>
    </tr>
    <tr>
    <td>age</td><td>
    <input name="age" type="text" value="${age}"></td>
    </tr> 
    <tr>
    <td>birthday</td><td>
    <input name="birthday" type="text" value="${birthday}"></td>
    </tr>  
    <tr>
    <td>graduation</td><td>
    <input name="graduation" type="text" value="${graduation}"></td>
    </tr>   
    <tr>
    <td>
    <input name="submit" type="submit"></td>
    <td>
    <input name="reset" type="reset"></td>
    </tr>    
    </table>      
    </form>
  </body>
2.registerAction.java
  public class RegisterAction extends ActionSupport {
private String username;
private String password;
private String repassword;
private int age;
private Date birthday;
private Date graduation;
         ..............
       public String execute()throws Exception{
return SUCCESS;
}
public void validate()
{
System.out.println("validate~~~~~~~~~~~~~~~~~~~");

if(null == username || username.length() < 6 || username.length() > 10)
{
this.addFieldError("username","username invalid");
}
if(null == password || password.length() < 6 || password.length() > 10)
{
this.addFieldError("password","password invalid");
}
else if(null == repassword || repassword.length() < 6 || repassword.length() > 10)
{
this.addFieldError("repassword","re-password invalid");
}
else if(!password.equals(repassword))
{
this.addFieldError("password","two passwords not the same");
}
if(age < 1 || age > 150)
{
this.addFieldError("age","age invalid");
}
if(null == birthday)
{
this.addFieldError("birthday","birthday invalid");
}
if(null == graduation)
{
this.addFieldError("graduation","graduation invalid");
}
if(null != birthday && null != graduation)
{
Calendar c1 = Calendar.getInstance();
c1.setTime(birthday);

Calendar c2 = Calendar.getInstance();
c2.setTime(graduation);

if(!c1.before(c2))
{
this.addFieldError("birthday","birthday should be before graduation");
}
}

}
3.struts.xml
<struts>
    <constant name="struts.custom.i18n.resources" value="message"></constant>
    <package name="struts2" extends="struts-default">
          <action name="login" class="com.test.action.LoginAction">
                 <result name="input">/login2.jsp</result>
                 <result name="success">/Result.jsp</result>
                 <result name="failer">/login2.jsp</result>    
          </action>
          <action name="pointConverter" class ="com.test.action.PointAction">
               <result name="success">/output.jsp</result>
          </action>
          <action name="register" class ="com.test.action.RegisterAction">
               <result name="success">/success.jsp</result>
               <result name="input">/register.jsp</result>
          </action>
    </package>
</struts>
4.success.jsp
<body>
    <table align="center" width="40%" border="1">
    <tr>
    <td>username</td>
    <td>${requeStscope.username}</td>
    </tr>  
    <tr>
    <td>password</td>
    <td>${requestScope.password}</td>
    </tr>
    
   
    <tr>
    <td>age</td><td>
    ${requestScope.age}</td>
    </tr>  
    <tr>
    <td>birthday</td><td>
    ${requestScope.birthday}</td>
    </tr>
    <tr>
    <td>graduation</td><td>
    ${requestScope.graduation}</td>
    </tr>  
    </table>    
  </body>