<legend id='fhCVi'><style id='fhCVi'><dir id='fhCVi'><q id='fhCVi'></q></dir></style></legend>
      1. <i id='fhCVi'><tr id='fhCVi'><dt id='fhCVi'><q id='fhCVi'><span id='fhCVi'><b id='fhCVi'><form id='fhCVi'><ins id='fhCVi'></ins><ul id='fhCVi'></ul><sub id='fhCVi'></sub></form><legend id='fhCVi'></legend><bdo id='fhCVi'><pre id='fhCVi'><center id='fhCVi'></center></pre></bdo></b><th id='fhCVi'></th></span></q></dt></tr></i><div id='fhCVi'><tfoot id='fhCVi'></tfoot><dl id='fhCVi'><fieldset id='fhCVi'></fieldset></dl></div>
        <tfoot id='fhCVi'></tfoot>
          <bdo id='fhCVi'></bdo><ul id='fhCVi'></ul>
      2. <small id='fhCVi'></small><noframes id='fhCVi'>

        如何在 Struts2 中提交表单的 URL 中传递参数

        How to pass a parameter in URL on a form submit in Struts2(如何在 Struts2 中提交表单的 URL 中传递参数)

          <bdo id='DQzwR'></bdo><ul id='DQzwR'></ul>

          <small id='DQzwR'></small><noframes id='DQzwR'>

              <tbody id='DQzwR'></tbody>

              • <i id='DQzwR'><tr id='DQzwR'><dt id='DQzwR'><q id='DQzwR'><span id='DQzwR'><b id='DQzwR'><form id='DQzwR'><ins id='DQzwR'></ins><ul id='DQzwR'></ul><sub id='DQzwR'></sub></form><legend id='DQzwR'></legend><bdo id='DQzwR'><pre id='DQzwR'><center id='DQzwR'></center></pre></bdo></b><th id='DQzwR'></th></span></q></dt></tr></i><div id='DQzwR'><tfoot id='DQzwR'></tfoot><dl id='DQzwR'><fieldset id='DQzwR'></fieldset></dl></div>

              • <legend id='DQzwR'><style id='DQzwR'><dir id='DQzwR'><q id='DQzwR'></q></dir></style></legend>

                  <tfoot id='DQzwR'></tfoot>
                1. 本文介绍了如何在 Struts2 中提交表单的 URL 中传递参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在 Struts2 中做一个项目,我需要在 URL 中设置一个参数,例如下面链接中的用户参数.

                  I am doing a project in Struts2 where I need of setting a parameter in URL like user parameter in below link.

                  我希望在单击表单提交按钮时传递此参数,而不是单独传递任何链接.我知道如何使用 <s:url> 做到这一点,但这样我需要创建一个链接而不是表单提交.

                  I want this parameter to be passed when I click a form submit button and not any links separately. I know how to do this with <s:url> but that way I need to create a link instead of form submit.

                  有人可以帮我提供一个代码示例如何做到这一点吗?我知道有一种方法可以使用 HTML 或 Struts1 来实现,但是如何使用 Struts2 来实现呢?如果在 struts.xml 中有办法做到这一点,请举例说明.

                  Can someone please help me with a code sample how to do this? I know there's a way to do it with HTML or Struts1 but how to do it with Struts2? If there is a way to do this in struts.xml, please explain with an example.

                  <form action="/example/xyz.action?user=george" method="POST">
                  

                  推荐答案

                  试试这个:

                  <s:form action="xyz.action" method="GET">
                      <s:hidden name="user" value="george"/>
                      // other fields
                  </s:form>
                  

                  method="GET" 将在 url 上显示您的参数,<s:hidden name="user" value="george"/> 将采用你的参数.

                  method="GET" will show your parameter on the url, <s:hidden name="user" value="george"/> will take your parameter.

                  这里也是一个例子例子

                  这篇关于如何在 Struts2 中提交表单的 URL 中传递参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                  <tfoot id='pNJXx'></tfoot>
                2. <legend id='pNJXx'><style id='pNJXx'><dir id='pNJXx'><q id='pNJXx'></q></dir></style></legend>

                  <small id='pNJXx'></small><noframes id='pNJXx'>

                    1. <i id='pNJXx'><tr id='pNJXx'><dt id='pNJXx'><q id='pNJXx'><span id='pNJXx'><b id='pNJXx'><form id='pNJXx'><ins id='pNJXx'></ins><ul id='pNJXx'></ul><sub id='pNJXx'></sub></form><legend id='pNJXx'></legend><bdo id='pNJXx'><pre id='pNJXx'><center id='pNJXx'></center></pre></bdo></b><th id='pNJXx'></th></span></q></dt></tr></i><div id='pNJXx'><tfoot id='pNJXx'></tfoot><dl id='pNJXx'><fieldset id='pNJXx'></fieldset></dl></div>

                          <bdo id='pNJXx'></bdo><ul id='pNJXx'></ul>
                              <tbody id='pNJXx'></tbody>