你看看你得对象映射文件,有可能是映射关系写错了
Account 对象放在FORM中,通过from.对象.属性 取值没问题,要保证你取到得是这个对象
Account 对象放在FORM中,通过from.对象.属性 取值没问题,要保证你取到得是这个对象
解决方案 »
- 这个句子是什么意思
- 用js递归xml文件遇到的问题!!!!
- 文件上传问题
- 求助axis配置问题
- Hibernate中使用DetachedCriteria进行多字段条件查询(之间关系为or)的问题
- 谁能给我一份网上购物的jsp代码
- 请问在action里面如何保存这样的字段呢?
- 分享知识,鼓励原创——BEA“原创技术高手”大比拼!
- 高手帮忙亚。一个Applet问题
- HibernateTemplate分页条件查询报空指针
- struts2+spring2+hibernate3 配置出现org.springframework.beans.NotWritablePropertyException
- 显示页面用星号
<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>
<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>