wood burning stoves 2.0*
The moose likes Struts and the fly likes Want keep same url in the browser address bar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Want keep same url in the browser address bar" Watch "Want keep same url in the browser address bar" New topic
Author

Want keep same url in the browser address bar

Subbarao Kondabala
Greenhorn

Joined: May 17, 2005
Posts: 27
Hi,

We are using struts1.2 and my requirement is after user login I want to keep the same url in browser address bar, even though the user clicks on different actions.

How can I acheive this?


Can any body help me regarding this.

Thanks and Regards,
Subbarao


Thanks and Regards,
Subbarao Kondabala
Paul Strachan
Greenhorn

Joined: Oct 24, 2004
Posts: 10
Hi,

The browser always displays the address of the last request - AFAIK you can't change that.

One option could be to redirect after each action to your "same url"; this action would only be responsible for "rendering" your page. With this approach all your forms and data need to be defined at session scope.

so, in each action you'd do something like:
in your "same url" render action:
Also if you're using tiles, utilising page controller can sometimes be useful (e.g. call the database to retrieve a list used by the page - storing it on the request)

If you can allow 1 Url per form with multiple methods, try the EventActionDispatcher.
Subbarao Kondabala
Greenhorn

Joined: May 17, 2005
Posts: 27
Thanks for the reply Paul.

Could you please expalin with some example
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

Subbarao Kondabala wrote:We are using struts1.2 and my requirement is after user login I want to keep the same url in browser address bar, even though the user clicks on different actions.

Why would you want to do that?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Want keep same url in the browser address bar
 
Similar Threads
url redirection
request authentication
Getting the URL in the address bar
Tabindex for URL window
RequestDispatcher display the servlet URL, not the jsp