你看看你得对象映射文件,有可能是映射关系写错了
Account 对象放在FORM中,通过from.对象.属性  取值没问题,要保证你取到得是这个对象

解决方案 »

  1.   

    是不是FormBean中的account没有初始化的原因啊,可以在Form中声明类的属性时初始化下看看
      

  2.   

    workingAccountForm里面没有account.username属性
      

  3.   

    username这个属性有问题  你看有没有写错 或者别的什么
      

  4.   


    <html:text name="workingAccountForm" property="account.username" />html:password name="workingAccountForm" property="account.password"/><html:password name="workingAccountForm" property="repeatedPassword"/>
    这是jsp中的片段片段中红色的即是出问题的地方。actionform中的对应的片段是private Account account;Account是actionform中的一个属性,它是一个类。我以前没碰见过actionform中属性是类的,这样jsp填充actionform时不知道能不能填?struts-config.xml应该没有问题<form-bean name="workingAccountForm" type="org.digitstore.web.struts.form.AccountActionForm"/>  <action path="/shop/newAccount"
              type="org.digitstore.web.struts.action.NewAccountAction"
              name="workingAccountForm" scope="session"
              validate="true" input="/WEB-INF/jsp/struts/NewAccountForm.jsp">
              <forward name="success" path="success.jsp"/>
      </action>
      

  5.   

    关键是怎么填充actionform中account类的属性。
      

  6.   

    actionform中account的getter setter有么?
      

  7.   

    楼主这么写再试试
    <html:text property="account.username" /> html:password property="account.password"/> <html:password property="repeatedPassword"/> actionform中
    private Account account; 
    public void setAccount(Account account){
        this.account = account;
    }
    public Account getAccount(){
        if(account==null) account = new Account();
        return account; 
    }struts-config.xml<form-bean name="workingAccountForm" type="org.digitstore.web.struts.form.AccountActionForm"/>   <action path="/shop/newAccount" 
              type="org.digitstore.web.struts.action.NewAccountAction" 
              name="workingAccountForm" 
              scope="request"
              input="/WEB-INF/jsp/struts/NewAccountForm.jsp"> 
          <forward name="success" path="success.jsp"/> 
      </action>