wood burning stoves*
The moose likes Servlets and the fly likes tweak a url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "tweak a url" Watch "tweak a url" New topic
Author

tweak a url

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Is it possible to tweak a url from within a jsp? My goal is to create a custom URL to display to the user. I didn't see any methods on the HttpServletResponse to do this. I think it is kindof what a servlet filter would do but I am not sure. Thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

I guess that depends upon what you mean by "tweak a URL"?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
By tweak I mean modify, such as append ?id=123 onto the end of the url that will be displayed.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

It's very common to build URLs up from strings within code.
Changing one would depend on where it's coming from.
Can you give us a specific example of what you want to do?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Ben, I wanted to actually avoid the seeing just action.do in my struts url. I wanted to instead display the parameters as well. I ended up solving this by changing my form action to get instead of post. I can now reshape the urls using the url rewrite filter library.
Thanks
 
Don't get me started about those stupid light bulbs.
 
subject: tweak a url
 
Similar Threads
Servlet errors
Padding for Numeric values
argh.. method intiliazation?
Handling of Requests by Apache Axis 2
Just a test