Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hide action name in browser address bar?

 
A Harry
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the moment any jsp forwarded to displays the action name i.e http://localhost:8001/WMMapGet.do in the browser address bar - is it possible to not show this?
Using IE 5.5 (sp2)
thanks
 
Josh Landin
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What would you prefer to see? The JSP form file name?
Maybe you're looking for redirect="true" on your forwards?
--
Josh
 
Satheesh Kumar G
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Can you pls. explain how to use redirect="true" option. Pls. post an example(of struts config and action class) if possible.
Best Regards,
Satheesh
 
Junilu Lacar
Bartender
Pie
Posts: 7316
45
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
redirect is an attribute in the forward element of an action-mapping in the struts-config.xml
You normally want to display the logical name (the Action path) so this actually hides the implementation name (the JSP).
 
A Harry
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the previous version of my app (not struts) - I used forward getRequestDispatcher(pageName).forward() to hide the actual JSP page the user was on - thereby only ever displaying the servlet name - this got around the problem of user's bookmarking any page & returning to them directly!
I was hoping to acheive the same with the rewritten struts app but can't seem to do it - is it best to put a check in all action commands checking for a session level variable & forward on to the start page if not set? - or what? - how is it normally handled using struts?
thanks
 
Junilu Lacar
Bartender
Pie
Posts: 7316
45
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by harryajh:
this got around the problem of user's bookmarking any page & returning to them directly!
- is it best to put a check in all action commands checking for a session level variable & forward on to the start page if not set? - or what? - how is it normally handled using struts?


See saveToken(), resetToken(), and isTokenValid() methods in the Action class.
 
A Harry
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for replying - do you know of anywhere on the web that explains what tokens are & how/what they're used for? - can't find anything!
Will these allow me to force control back to a specific page if the user has bookmarked a page?
thanks
 
Junilu Lacar
Bartender
Pie
Posts: 7316
45
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... a Google for "saveToken resetToken" turned up a bunch of links.
Try this one though: http://www.osborne.com/products/0072227117/0072227117_ch01.pdf
It has a section discussing the use of those methods.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic