Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Struts : URL Problem during Action forward

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
some body should have answer for this.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic