aspose file tools*
The moose likes Struts and the fly likes Struts : URL Problem during Action forward Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts : URL Problem during Action forward" Watch "Struts : URL Problem during Action forward" New topic
Author

Struts : URL Problem during Action forward

mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
Hi

I am able to get to the correct forward page from my Action Class, but the problem is the URL shown on the browser is the path to the my Action Class in the struts config

i,e http://blah.blah/do/MyActionServlet

I was expecting it to show http://blah.blah/common/tools/AdminScreen.

As I said above even though the page i see is the correct one but the URL is still the do Action. Is there any way to actually show the right URL.
mini mehta
Ranch Hand

Joined: Oct 22, 2000
Posts: 120
some body should have answer for this.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Well, the do action IS the right URL.

The browser will display whatever the user last requested. In the case of Struts, this is .do and it's a bit of a paradigm shift for web developers. I don't know what else to tell you.


A good workman is known by his tools.
Lionel Port
Greenhorn

Joined: Sep 14, 2002
Posts: 19
The do action is the correct url.

If it really bothers you can set redirect=true in your forward definition in struts-config.xml. This has two problems though, first you have extra communcation with the browser, where the browser gets a redirect and then has to request the the next page, secondly it will stop you storing an information you want to pass on the the forward in the request, instead if there is information you want to keep you will have to store it in the session.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts : URL Problem during Action forward