日期:2014-05-17  浏览次数:20597 次

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}"/>