无法继续使用 Spring Roo:高级 MVC 问题

发布于 2024-11-02 07:37:01 字数 867 浏览 1 评论 0原文

我计划开始一个新项目,并决定采用一项我没有经验的新技术来让我的生活更轻松:Spring!

特别是Spring Roo,这就是我的问题。

Spring Roo 做了很多自动魔法的东西,我真的不知道如何继续。由于这有可能变成咆哮,所以让我更具体一些,然后提出我的问题:

Spring 非常适合设置我的类并使用 Hibernate 等来持久化它们。我遇到的主要问题是尝试搭建我的项目。

我正在开发一个项目,该项目管理一些具有多对多和多对一关系的“集”引用。这立即会给脚手架应用带来问题。

尝试通过“gwt setup”添加 Google Web Toolkit 会立即终止应用程序。尝试加载 Tomcat 服务器变得不可能,并且无法撤消该过程(据我所知)。现在怎么办?据我所知,我必须从原始命令重新启动我的项目并重新应用我的更改。

话虽如此,在我看来,最好的过程是使用 ROO 生成我的项目工件,然后创建我自己的视图/控制器设置。即使在这里我也遇到了问题,因为图块配置似乎对其工作原理非常模糊。我很难弄清楚如何采用自定义 JSP 来处理一些复杂的多对一关系(启用 AJAX)并将其添加到我的 Web 前端。

有这方面的指南吗?

仅供参考:在现有的 Roo 生成的 MVC 中,我尝试

  • 复制 JSP
  • 创建一个包装不同实体类型的表单支持对象
  • 修改文件夹中的views.xml 文件以识别页面

其中之一是完成的,但我不确定如何实现继续。如何访问我的 JSP?手动输入在views.xml 中定义的URL 不起作用。

我是否应该考虑完全放弃 Roo 并从头开始一个 Spring 项目?

I was scheduled to begin work on a new project and decided to make my life easier by adopting a new technology that I had no experience with: Spring!

Specifically Spring Roo, and therein lies my problem.

Spring Roo does so much auto-magical stuff that I really do not know how to proceed. As this runs the risk of turning into a rant, let me be more specific and then follow it up with my question:

Spring works great for setting up my classes and persisting them with Hibernate and all that. The main problem I am having is in trying to scaffold my project.

I am working on a project that manages a few "set" references with many-to-many and many-to-one relationships. This immediately will have problem with the scaffolding application.

Trying to add Google Web Toolkit via 'gwt setup' kills the application immediately. Trying to load in Tomcat server becomes impossible and there is no way to undo the process (as far as I know). Now what? I have to restart my project from the original commands and reapply my changes as far as I can tell.

With this being said it seems to me that the best process is to use ROO to generate my project artifacts and then create my own View/Controller setup. Even here I am having problems though, because the tiles configuration seems so obscured from how it works. I am having a hard time figuring out how to take a custom JSP that can process some of these complex many-to-one relationships (AJAX enabled) and add it to my web front.

Are there any guides for this?

FYI: in the existing Roo Generated MVC I tried

  • Copying over my JSP
  • Creating a Form Backing Objects that wraps the different entity types
  • Modifying the views.xml file in the folder to recognize the page

One this was accomplished, though, I have been unsure how to proceed. How do I access my JSP? Manually typing the URL as it is defined in views.xml does not work.

Should I think about abandoning Roo altogether and starting a Spring project from scratch?

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

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

发布评论

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

评论(1

染年凉城似染瑾 2024-11-09 07:37:01

学习 Spring Roo 的方式

  • 请阅读文档 (Spring Roo, < a href="http://static.springsource.org/spring/docs/current/spring-framework-reference/htmlsingle/spring-framework-reference.html" rel="nofollow noreferrer">在此处输入链接描述)
  • 尝试 Roo 并观察控制台输出。查看更改的文件,如果添加新控制器等会发生哪些更改。
  • 阅读并讨论 SpringSource 中的问题论坛
  • 关注SO中的spring-roo标签

使用Spring Roo搭建

Bet way to learn Spring Roo

Using Spring Roo for scaffolding

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