通过多个jsp页面进行动态导航

发布于 2024-10-24 05:09:20 字数 1027 浏览 4 评论 0原文

你好
我正在使用 Spring 3.0、Hibernate 和 JSP 页面作为视图技术来开发 Web 应用程序。我陷入了将页面链接在一起的问题上。

情况如下:
我确实启动并运行了简单的 jsps,用于添加、编辑(相同的表单)和显示所有元素(使用数据表)。到目前为止,一切正常,因为我仅使用索引页面中的所有记录访问网格,从那里我可以打开编辑页面(后退按钮仅链接到网格以及用于向网格添加点的控制器方法)。
但是我确实有一些连接的记录:

  • 请购单
  • 解析
  • 名称
Obviously I can display each 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).

经过几个小时的编码和大量思考后,我无法想出如何将此“堆栈”信息从一个页面传递到另一个页面的解决方案。

我将不胜感激任何建议(框架或解决方案)。
PS。如果您需要一些源代码,只需编写,我会尽快将其发布在这里,但我认为这个问题更多的是关于一个想法和一般解决方案,而不是为我的特定代码制定一些解决方案。
PS2。问题还在于我不知道需要多少层关联,因此需要一些通用的解决方案。

Thank you for you advice and patience.
Johnnnie

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 each 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

病女 2024-10-31 05:09:20

让我们讨论一下 portlet,认为您正在使用 portlet。 portlet 的索引 JSP 将以

 <%@ 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 开头,位于控制器内

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

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
 }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文