aspose file tools*
The moose likes Struts and the fly likes params in the url - struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "params in the url - struts 2" Watch "params in the url - struts 2" New topic
Author

params in the url - struts 2

stefano biondi
Greenhorn

Joined: Dec 04, 2010
Posts: 5
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

Joined: Aug 03, 2008
Posts: 9302
    
  17

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...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
stefano biondi
Greenhorn

Joined: Dec 04, 2010
Posts: 5
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

Joined: Dec 04, 2010
Posts: 5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: params in the url - struts 2