关于struts标签的问题,在线

来源:百度知道 编辑:UC知道 时间:2024/09/22 06:58:43
在struts中用<html:text>标签,用bean来标示value值,为什么在页面中输入半角单引号("),在后台用form.get方法取到的值只有引号之前的呢?
eg: 输入 str"abc 就只会取到str
还有输入<"abc">这样的值,页面刷新后会在这个text框之后的空白地方出现 < 的符号呢?
谢谢解答了!!

<html:text property="trueName" value="<bean:write ..../>">
这样是不行的.
因为在struts本身的标签不能再套别的标签或<%...%>之类的脚本..否则只能当字符串处理或者不处理..

你可以用
<bean:defined id="name" property="trueName"/>
<%request.setAttribute("name",((Object)name).toString());%>
<html:text property="trueName" value="${name}"/>

其它方案请高手献技..

i d nat