Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using forwarded url

 
Kevin DesLauriers
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • 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?
 
Akhilesh Trivedi
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • 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
  • 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: 1608
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Paul Clapham
Sheriff
Posts: 21581
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Much appreciated! I will make the change in my design.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic