• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

params in the url - struts 2

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic