<input type="hidden" name="userid" value="<bean:write name="cid"/>">

解决方案 »

  1.   

    <html:hidden property="userid" value='<bean:write name="cid"/>' />
      

  2.   

    <html:hidden property="userid" value="<bean:write name=\"cid\"/>" />
      

  3.   

    如果是一个规范项目的话,建议减少对基本html标签的使用。尽量使用封装好的框架自定义标签
      

  4.   

    String aaa = "<bean:write name=\"cid\"/>";
    <input type="hidden" name="userid" value="<%=aaa%>">
      

  5.   

    shine333(enihs),你的方法<html:hidden....>最后结束如果不是/>,会提示错误
    bixuehui(伯克),你的方法取到的不是实际的uid属性值,而是字符串<bean:write name="cid"/>
      

  6.   

    在action中把值对象set到form里,回传到页面上。
    直接<html:hidden property="userid"/>就可以了。
      

  7.   

    那好像只能这样了:<input type="hidden" name="userid" value="<bean:write name="cid"/>">
    不能用html:hidden
      

  8.   

    blackdreamzg(基本靠手),我的是index.jsp,也就是第一页阿,action从何而来
      

  9.   

    回到jsp老路:
    <% String cid=(String)session.getAttribute("categoryid"); %>
    <html:hidden property="cid" value="<%= cid %>" /> 
    成功
    struts的标签,Sucks!
      

  10.   

    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}" />
    能更漂亮点
      

  11.   

    我觉得没有必要那么花哨,特别是hidden,因为没人会/能/想要修改或扩展hidden无非就是为了产生<input type="hidden" name="userid" value="cid的值"/>这样的代码而已,没必要搞的那么复杂。楼主,请看清楚,我这里不是<html:hidden/>而是<input type="hidden"> 当然,最后那个/>如果是xhtml的话是必须的