File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes url rewriting with struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "url rewriting with struts" Watch "url rewriting with struts" New topic

url rewriting with struts

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Can you please help me understand how to use url-rewriting with struts? I would like (if possible) to perform url parameter getting and setting in my action class versus in the jsp. I am trying to use account for sessions when the client browser has cookies disabled. Sample code is appreciated!

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Struts automatically performs URL rewriting. If you use struts tags for all your links and <html:form> instead of <form>, you don't have to worry about URL rewriting at all, because Struts does it for you.

It's important to understand, though, that using URL rewriting to keep track of the HttpSession is a setting that is made in the Application Server. Consult your app server's documentation for information on how to turn this function on.

Consultant, Sima Solutions
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
I am using Tomcat 5.0.28. Struts is not adding a url parameter of any kind. I am returning an ActionForward from the action class and all JSPs use <html:form>. But say I wanted to add my own custom parameters, how would I do that?
I agree. Here's the link:
subject: url rewriting with struts
It's not a secret anymore!