读书人

struts1 form表单填充有关问题

发布时间: 2012-01-24 23:11:55 作者: rapoo

struts1 form表单填充问题
我从后台传了一个form希望能把值传到jsp页面 <input type="text" id = "ids" value="${form.creditsubjectname}"/>
还是<input type="text" id = "ids" value="${creditsubjectname}"/> 貌似都不行
WhiteListForm wf = (WhiteListForm)form;(creditsubjectname是WhiteListForm 里面的属性)
没用过struts1求指教

[解决办法]
我也没用过struts1 不过我觉得struts1应该有自己的标签吧 去找找应该很容易的
[解决办法]
如果你传的是form 这样写

HTML code
 <input type="text" id = "ids" value="${form.creditsubjectname}"/>
[解决办法]
要把后台取得的数据放到Request或session中,一般都是放到Request中,这样才能在jsp中取得数据。

request.setAttribute("form", wf);


<input type="text" id = "ids" value="${form.creditsubjectname}"/>

读书人网 >Java Web开发

热点推荐