Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Modify struts url

 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to take a query parameter and place it on a url that gets displayed to the user?

For example, if I normally display this to my user: http://www.myapp.com/myaction.do

and i have a hidden field populated from my actionform called test with a value of 123, I would rather have the url appear as

http://www.myapp.com/myaction.do?test=123

Thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Andy Hahn:
Is it possible to take a query parameter and place it on a url that gets displayed to the user?


Yes, it is. Just insert method="get" in your html:form tag. This will cause all form fields to be displayed as parameters in the query string. The problem is that it's all or nothing. You can't display some fields in the query string and hide others.
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect! I understand there are some limitations with using GET versus POST, such as length of urls submitted. Do you know the max size of Tomcat5.5 and web browsers, as well as any other related drawback under struts1.3.8?

Thanks!
 
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic