• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

params in the url - struts 2

 
stefano biondi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm using struts 2

i have a form and a list in a page

when i call the action of the form (insert for example), i loose the params in the url

how can i keep that params ?

thanks and sorry for my bad english
 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you have a query string in the action attribute of the form which is getting list when the form is submitted. This has nothing to do with struts. Its the way browsers work. Try either POST method for the form or create hidden form fields in your form instead of query string...
 
stefano biondi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe i have explained in a bad way

in my struts.xml i have somtehing like

<action name="authentication" method="execute" class="MyClassAction">
<result name="redirect" type="redirect">/private/page.action</result>
</action>

or somtehing like

<action name="privateZone/funz/send_data" method="execute"
class="MyClassAction2">
<result name="success" type="tiles">myPage</result>
</action>

when the method execute is finished i go to another page or to the same page (it depends from result name attribute) but i loose the param i have in the url before clicking the submit of the form; how can avoid this behaviour?

for example i remember that in struts 1 i could decide the return page from the code of my action class e i could add some param to this url

thanks and sorry for my bad english
 
stefano biondi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe i have understood, i have to use get method in form and use a hidden to keep my param, if it is so simple i'm very stupid

thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic