Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts : URL Problem during Action forward

 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
some body should have answer for this.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lionel Port
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic