Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pure JSP page navigation best practice?

Tags:

jsp

servlets

What's the best way I can implement navigation links between various JSP pages of my Web app?

Suppose that I have a list.jsp that shows a list of items. Then the user clicks on one of these items to view the item in more details in view.jsp. Now I need a link from view.jsp back to list.jsp. However, list.jsp is not the only page that contains a link to view.jsp. For example, it is possible to go to view.jsp, from search.jsp as well. Besides that, each of list.jsp and search.jsp might have different parameters and attributes that affect the output they produce.

At the moment I have implemented this in a straightforward way using a parameter called source that shows the page that the user has clicked to go to the current page and by passing other parameters or attributes between the page to be remembered. However, I thought there might be a best practice for implementing this sort of functionality in a pure JSP+Servlet way and I wanted to ask about this before I proceed.

Thanks in advance.

like image 668
Behrang Avatar asked Nov 14 '22 11:11

Behrang


1 Answers

You should check post/redirect/get webdesign pattern it may help you to know how to create a good navigation system on your webapp and how to handle the back :)

like image 107
Sebastien Lorber Avatar answered Dec 21 '22 10:12

Sebastien Lorber