当前位置: 代码迷 >> Java Web开发 >> 我想把JSP中JAVA片段得到的值通过超连接或者提交按钮传到对应的ACTION类中 ...
  详细解决方案

我想把JSP中JAVA片段得到的值通过超连接或者提交按钮传到对应的ACTION类中 ...

热度:101   发布时间:2008-01-10 21:48:20.0
我想把JSP中JAVA片段得到的值通过超连接或者提交按钮传到对应的ACTION类中 怎么实现?(有代码片段)
程序代码:
<% String s = (String)request.getAttribute("idd");  %>
        <html:form action="/update?iddd=  " >
        <bean:message key="xingming" /><html:text property="xingming" />
            <html:errors property="xingming" />
            

            <bean:message key="dianhua" /><html:text property="dianhua" />
            <html:errors property="dianhua" />
            

            <bean:message key="dizhi" /><html:text property="dizhi" />
            <html:errors property="dizhi" />
            



            <html:submit />
            <html:cancel />
        </html:form>
比如这个   我想把S通过提交传到/update对应的action类中     怎么弄?
搜索更多相关主题的帖子: ACTION  JAVA  片段  JSP  按钮  

----------------解决方案--------------------------------------------------------
<html:form action="/update?&iddd=<%=s%>">
你看看行不
----------------解决方案--------------------------------------------------------
那样试验了不行 可能是我写的格式不对吧
用两个标签弄好了
<bean:define id = "s" name = "idd"/>
<html:hidden property="id" value = "s"/>
idd是上一request的键,s是给idd的名字,再用html:hidden 标签值给s,提交时就传过去了
那边就可以用getId()的方法得到了
----------------解决方案--------------------------------------------------------