• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Modify struts url

 
Andy Hahn
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
 
Merrill Higginson
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic