views:

1160

answers:

2

Hi all,

My Web application makes use of Ext JS & Java web technology. Due to the size and complexity of the application, I need to do a complete refresh of the page (load a different page) when user select some menu from the menu bar. What is the best what to redirect to the required page?

For example, In my main menu, I have two menu Stock & Location. These two menu will take the user to different JSP files (stockmgt.jsp & locmgt.jsp) with new layouts,menu items etc.

One possibility is to use location.href in the button or menu handler. But if I do this, will I retain the session variables, and other parameters?

What are the best practices in doing these kind of redirect or page refresh?
Thanks in advance for the ideas, comment and suggestions.

Regards,
Abdel Olakara

+1  A: 

location.href will do, unless otherwise if they are on different domain.

jerjer
A: 

Add this to your clickable element:

onclick = "location.href='anotherpage.jsp'"

For example:

< img src="blablabla.png" onclick="location.href='anotherpage.jsp'" >

M28