Spring 3 MVC 和模式向导

发布于 2024-10-29 08:37:10 字数 539 浏览 0 评论 0原文

我正在考虑在现有的 Spring 3 MVC+JPA+Jquery+JSP 应用程序中集成一个向导。我希望该向导基于 jquery 模态叠加,但如果有必要,我愿意考虑其他框架。

我查看了 Spring Webflow - 但无法弄清楚如何让它与模态叠加一起工作。我确实找到了一个教程 http://realworldagile.wordpress.com/2009/10/06/modal-wizard-forms-using-spring-webflow-2-0-8-and-richfaces/ 但它是与 RichFaces 相关。

我无法弄清楚

  1. 如何在覆盖层中启动向导,
  2. 如何从一个覆盖层屏幕转换到另一个覆盖层屏幕 - 作为状态转换的一部分。
  3. 如何在覆盖层内进行服务器端验证

I'm looking at integrating a wizard in an existing Spring 3 MVC+JPA+Jquery+JSP application. I would prefer the wizard to be based on jquery modal overalays, however am open to considering other frameworks if necessary.

I looked at Spring Webflow - but am not able to figure out how to get it working with modal overlays. I did find one tutorial http://realworldagile.wordpress.com/2009/10/06/modal-wizard-forms-using-spring-webflow-2-0-8-and-richfaces/ but it is tied to RichFaces.

I am not able to figure out

  1. how to launch a wizard in an overlay
  2. how to transition from one overlay screen to another - as part of the state transitions.
  3. how to do server-side validations within the overlay

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

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

发布评论

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

评论(3

瀟灑尐姊 2024-11-05 08:37:10

您可以使用子流:http://static。 springsource.org/spring-webflow/docs/2.3.x/reference/html/ch03s09.html

这样,您可以在返回当前流程之前遵循辅助流程(向导部分)。从功能角度来看,与模态覆盖类似,但具有所有标准 WebFlow 机制和功能(例如服务器端验证)。

You may use subflows : http://static.springsource.org/spring-webflow/docs/2.3.x/reference/html/ch03s09.html

This way you can follow a secondary flow (the wizard part) before returning back to the current one. Kind of the same as a modal overlay from a functional perspective, but with all standard WebFlow mechanisms and features (e.g. server-side validation).

两人的回忆 2024-11-05 08:37:10

我认为,如果可能的话,不要在向导的步骤中使用 SS 验证。可能的是,如果您只能在客户端实现向导模式,因为您不需要服务器上部分正确的数据(一些对话页面已完成,但有些则没有)。当然,您可以附加 jBPM、活动、Spring WEB Flow 来解决这个问题,但我认为大多数向导只需要类似 这个。用户在一页中填写所有步骤的数据,您在 JS 端验证并收集它,然后单击“完成”-您发送数据并在 SS 中再次验证。

I think, if it possible - don't use SS validation within steps in wizard. Possible, if you can implement wizard pattern only in client side, because you don't need partially correct data on server (some conversation pages done, but some don't). Course, you can attach jBPM, activity, Spring WEB Flow to solve this problem, but i think for most wizards need only something like this. User fill data in all steps at one page, you validate and collect it in JS side, after him click "Finish" - you send data and validate again in SS.

笑梦风尘 2024-11-05 08:37:10

如果使用 webflow,似乎答案是在“嵌入”模式下使用 web flow(请参阅 嵌入模式)。特别是,jQuery 中的 ajax 处理程序将用从服务器发送的片段替换模式对话的内容(请参阅 ajax)。

就我个人而言,我使用过这个 jQuery UI wizard 插件;在这种方法中,您生成模型,并由 Spring MVC 使用 json 从控制器发送该模型,您可以在 jQuery ajax 处理程序中以编程方式使用该模型,该处理程序又链接到向导的步骤。我认为这将是您更手动的选择。

If using webflow, it seems the answer is to use web flow in 'embedded' mode (see embedded mode). Particularly, your ajax handler in jQuery will be replacing the content of the modal dialogue with fragments sent from the server (see ajax).

Personally, I have used this jQuery UI wizard plugin; in this approach, you generate the model and it is sent by Spring MVC from the controller using json, which you use programmatically in your jQuery ajax handler, which in turn is linked to the steps of the wizard. I think this would be your more manual alternative.

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