• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hide action name in browser address bar?

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic