• 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

using forwarded url

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am fairly new to struts (using 1.2) and was hoping that someone could help me with my question.

I am configuring the struts-config.xml file to forward to a particular page and it does with the path's original url as expected with a forward.

My question is, how do I place the forwarded URL in the address bar instead of the .do resource?
 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kevin DesLauriers:
.
.
.
I am configuring the struts-config.xml file to forward to a particular page and it does with the path's original url as expected with a forward.
.
.



is the page static or dynamic???
 
Kevin DesLauriers
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Currently the page is static. I am using a link on the page to update a database and then return back to the same page.

The page is jsp/home.jsp and it has a link to update.do that is mapped to a class in the struts config. When it returns success it is supposed to forward back to the same page "home.jsp" (for now).

It words except that when I return to the home.jsp page it shows update.do and I would much rather it show home.jsp in the address bar.

Thanks
 
Akhilesh Trivedi
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I simply dont get why you want to change the URL in address-bar ? :roll:
 
Kevin DesLauriers
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is not that I want to change the URL in the address bar; I would just rather it reflect the page it is displaying instead of a fake .do name that is used to send a request to a particular action class.

Ex.

A user is on the /jsp/home.jsp page and has the option of refreshing data in the database by clicking a button or link. When this is done I want the user to be forwarded to the same page /jsp/home.jsp and have the URL in the address bar reflect that they are at /jsp/home.jsp not /stats.do.
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kevin DesLauriers:
When this is done I want the user to be forwarded to the same page /jsp/home.jsp and have the URL in the address bar reflect that they are at /jsp/home.jsp not /stats.do.

Then in that case you would redirect to that URL instead of forwarding to it. But if you do that, the user can bookmark that URL and go directly to it at some time in the future. This is a feature, not a bug, so if it doesn't make sense for the user to go directly to that URL then you shouldn't expose it to the user in the way you are proposing.
 
Kevin DesLauriers
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Much appreciated! I will make the change in my design.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic