struts中,html:hidden的问题 <input type="hidden" name="userid" value="<bean:write name="cid"/>"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html:hidden property="userid" value='<bean:write name="cid"/>' /> <html:hidden property="userid" value="<bean:write name=\"cid\"/>" /> 如果是一个规范项目的话,建议减少对基本html标签的使用。尽量使用封装好的框架自定义标签 String aaa = "<bean:write name=\"cid\"/>";<input type="hidden" name="userid" value="<%=aaa%>"> shine333(enihs),你的方法<html:hidden....>最后结束如果不是/>,会提示错误bixuehui(伯克),你的方法取到的不是实际的uid属性值,而是字符串<bean:write name="cid"/> 在action中把值对象set到form里,回传到页面上。直接<html:hidden property="userid"/>就可以了。 那好像只能这样了:<input type="hidden" name="userid" value="<bean:write name="cid"/>">不能用html:hidden blackdreamzg(基本靠手),我的是index.jsp,也就是第一页阿,action从何而来 回到jsp老路:<% String cid=(String)session.getAttribute("categoryid"); %><html:hidden property="cid" value="<%= cid %>" /> 成功struts的标签,Sucks! index.jsp怎么就不能有Action?你看看struts自带的blank.war就行。非要用标签做的话也可以。这个:<% String cid=(String)session.getAttribute("categoryid"); %><html:hidden property="cid" value="<%= cid %>" /> 改成:<bean:define id="cid" property="categoryid" scope="session"/><html:hidden property="cid" value="${cid}" />能更漂亮点 我觉得没有必要那么花哨,特别是hidden,因为没人会/能/想要修改或扩展hidden无非就是为了产生<input type="hidden" name="userid" value="cid的值"/>这样的代码而已,没必要搞的那么复杂。楼主,请看清楚,我这里不是<html:hidden/>而是<input type="hidden"> 当然,最后那个/>如果是xhtml的话是必须的 jdk里的demo 列子在哪下载啊? 一个struts提交的问题 毕业生就业信息跟踪系统 jmsn发送MSN的留言问题 Hibernate的delete怎样绑定实体参数? 有个初级问题,望前辈们指教,谢谢! 请问学习J2EE应该从何下手,学什么? struts1.1中对hidden域的验证问题 急!!!!高手请进!!!!!在线等!!!! 我用JBuild8自动生成了一个EntityBean,BMP的,又自动生成了一个TestClient.java来测试这个EntityBean,却报错?????(在线等待) 如果转换数组 关于动态存储
<input type="hidden" name="userid" value="<%=aaa%>">
bixuehui(伯克),你的方法取到的不是实际的uid属性值,而是字符串<bean:write name="cid"/>
直接<html:hidden property="userid"/>就可以了。
不能用html:hidden
<% String cid=(String)session.getAttribute("categoryid"); %>
<html:hidden property="cid" value="<%= cid %>" />
成功
struts的标签,Sucks!
你看看struts自带的blank.war就行。
非要用标签做的话也可以。
这个:
<% String cid=(String)session.getAttribute("categoryid"); %>
<html:hidden property="cid" value="<%= cid %>" />
改成:
<bean:define id="cid" property="categoryid" scope="session"/>
<html:hidden property="cid" value="${cid}" />
能更漂亮点