Spring MVC(xml 配置噩梦?) vs spring roo?
我正在深入研究 spring mvc (或 spring roo),从我读到的内容来看,spring mvc 的配置似乎是一场噩梦。我必须配置 XML 文件,这是 web.xml 文件吗???或者有什么不同?
它仍然是一场噩梦还是已经有所改善?
这些 XML 文件没有编辑器吗?我正在使用 eclipse IDE
Spring roo 显然没有 spring mvc 的 XML 配置担忧。
我希望有人能解释这些差异..
提前致谢
I am just delving into the spring mvc (or spring roo), from what i have read it appears that spring MVC can be a nightmare to configure. I have to configure XML files, is this the web.xml file??? Or something different?
Is it still a nightmare or has it been improved?
Is there no editor for these XML files? I am using eclipse IDE
Spring roo apparently does spring mvc without XML config worries.
I would love anyone to explain the differences..
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先 Spring MVC 的配置并不是一场噩梦,你只需要知道你在做什么。
为此,我建议您下载 Spring IDE,它有很多 XML 编辑器,如果您没有使用 Spring XML 的经验,这些编辑器可以让您的生活更轻松。
基本上你必须配置两件事
需要在其中包含一些 spring MVC 配置)
一当你了解它们后,你会发现它很容易配置并且非常灵活。
需要注意的一件事是 Spring 和 Spring MVC 是不同的东西,我建议你学习它们。
Spring Roo 也是一个代码生成器,对于 Cruds、简单的事情和设置项目来说它很棒,但是如果您需要构建一个需要支持的合理的大型应用程序,那么您自己创建所有内容总是更容易,因为当您知道代码时更容易支持,所以请小心使用。
First Spring MVC is not a nightmare to configure, you just have to know what you are doing.
For that I would suggest you to download Spring IDE, which have a lot of XML editors that make you life easier if you are not experienced with Spring XMLs.
Basicly you have to configure 2 things
need to include some spring MVC configs in it )
one you get to know them you will find it easy to configure and very flexible.
One thing to notice Spring and Spring MVC are different things, I advise you to learn both of them.
Also Spring Roo is a code generator, for Cruds, simple things and setup projects it's great but if you need to build a reasonable big app that will need support it's always easier to create everything youself because it's easier to support when you know the code, so use it with care.
我想补充一点,Spring XML 配置可以简单到几行,大部分工作都是通过注释完成的。这样做可能并不总是更好,但这是一种选择。当有意义时,可以在机制之间划分配置。
您可能需要花一些时间阅读 Spring 文档,至少是有关您正在使用的组件的文档。如果您认为配置它是一场噩梦,那么等到您必须在不了解底层框架如何工作的情况下诊断基于约定的魔法带来的问题时。
I'd add that Spring XML configuration can be as simple as a few lines, with the bulk of work done via annotations. It may not always be preferable to do it that way, but it's an option. Configuration can be divided between mechanisms when it makes sense to do so.
You might want to spend some time with the Spring documentation, at least regarding the components you're using. If you think configuring it is a nightmare, wait until you have to diagnose a problem brought about by magic based on convention without understanding how the underlying framework(s) work.