Spring MVC (xml config nightmare?) Vs Spring roo?

I'm just delving into spring mvc (or spring roo), from what I read, it seems that spring MVC might be a nightmare to configure. I have to configure the XML files, is this a web.xml file ??? Or something different?

Is this another nightmare or has it improved?

Is there an editor for these XML files? I am using the eclipse IDE

Spring roo seems to make spring mvc without XML configuration issues.

I would like someone to explain the differences.

Thank you in advance

+4
source share
2 answers

The first Spring MVC is not a configuration nightmare, you just need to know what you are doing.

To do this, I would suggest you download the Spring IDE, which has many XML editors that will make your life easier if you are not familiar with Spring XML.

Basically you need to configure 2 things

  • Web.xml (it's not because of Spring it's Java EE, but you need to include some Spring MVC configurations in it)
  • applicationContext.xml (here you define what you want from Spring)
  • servlet-context.xml (this is also from Spring MVC and has some servlet definitions as well as some routes)

which you learn, it will be easy for you to configure and very flexible.

One note from Spring and Spring MVC are different things, I advise you to study both of them.

In addition, Spring Roo is a code generator, for Cruds, simple things and installation projects this is great, but if you need to create a reasonable large application that needs support, it will always be easier to create everything because it is easier to maintain when you know the code, so use it with caution.

+8
source

I would add that Spring XML configuration can be as simple as a few lines, with most of the work being done through annotations. It may not always be preferable to do it this way, but this is an option. A configuration can be shared 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 use. If you think that setting is a nightmare, wait until you have to diagnose the problem caused by magic based on the agreement, not understanding how the basic structures work.

0
source

All Articles