Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JSP and the fly likes Regarding refreshing a JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Regarding refreshing a JSP page" Watch "Regarding refreshing a JSP page" New topic

Regarding refreshing a JSP page

Sharmeela Manivannan

Joined: Aug 11, 2005
Posts: 1
im designing a shopping that when add to cart is clicked..if not logged previously..login form is given in javascript window.after the login is successful,the shopping page they are currently in should refreshed..with session value of the user..but the contents of the apge should be retained...
Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
From a use-case point of view, generally you would not need to login to add items to your shopping basket - only when you are checking out.

Relying on JavaScript to log people in is a bad idea, for reasons of browser compatabilities and the fact that some people disable JavaScript

Drinking more tea is the key...
Yuriy Zilbergleyt
Ranch Hand

Joined: Dec 13, 2004
Posts: 429
If you insist on using javascript, I'd recommend using either hidden iframes or Ajax (preferable, but some compatibility issues) to get data from the server without reloading the entire page. Look in the HTML/Javascript forum for more info.

I agree. Here's the link:
subject: Regarding refreshing a JSP page
It's not a secret anymore!