开发者

Dynamic navigation through multiple jsp pages

开发者 https://www.devze.com 2023-02-17 23:42 出处:网络
HelloI am developing web application using Spring 3.0, Hibernate and JSP pages as a view technology. And I am stuck on the problem of linking pages together.

Hello

I am developing web application using Spring 3.0, Hibernate and JSP pages as a view technology. And I am stuck on the problem of linking pages together.

Here is the situation:

I do have simple jsps up and running for adding, editing (same form) and displaying all elements (using datatables). So far everything works as I am only accesing the grid with all records from index page, from where I can open an edit page (back button just links to the grid and a controller method for adding points to grid also).

But I do have some records connected:

  • requisition
  • resolution
  • appelation
Obviously I can display ea开发者_StackOverflow中文版ch of those on their own as well as edit. But each requisition has list of associated resolutions (so when you display a resolution update form, grid with associated resolutions should be present) and you should be able to open edit form for picked resolution where situation repeats with appelations for the resolution. Problem is that I would like to have "back button" on each edit form which would take you "one step back" (sort of a stack).

After several hours of coding and lot of thinking I was not able to come up with the solution how to pass this "stack" info from one page to another.

I would be thankful for any advice (either framework or solution).

PS. If you need some source code just write and I will post it here ASAP but I consider this question more to be about an idea and general solution than crafting some solution for my particular code.

PS2. Problem also is that I do not know how many layers of associations will be needed so some general solution is needed.

Thank you for you advice and patience.

Johnnnie


Lets talk about portlets thinking you are working with portlets. The index JSP of your portlet will start with

 <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
 <portlet:defineObjects/>
 <portlet:resourceURL var="requisitionURL" id="requisition" action="requisitionURL"    escapeXml="false" />
 ...
 <td>Click <a href="requisitionURL">here</a> for requisition</td>
 ...

And within your controller

 @Controller
 ResourceRequest(param="action=requisitionURL")
 public class{
 ...Your to do
 return requisition.jsp
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消