This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Struts and the fly likes params in the url - struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply 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
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9191
    
    2

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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: params in the url - struts 2
 
Similar Threads
Removing HttpServletRequest parameters
struts Action for asynchronous HTTP processing
Newbie
Displaying AJAX response
Best Strategies of Passing output data to web tier