When comparing Spring MVC vs Grails, the Slant community recommends Spring MVC for most people. In the question“What are the best JVM web frameworks?” Spring MVC is ranked 2nd while Grails is ranked 4th. The most important reason people chose Spring MVC is:
Being the oldest and most used JVM web framework, means that Spring MVC has a massive community of followers who are very helpful and have provided numerous tutorials and answers on SO. Spring even holds an annual conference called SpringOne. The Spring forums and SO are great places to ask and get help about anything Spring related. The website blog and newsletter keep developers informed on every news related with the framework.
Ranked in these QuestionsQuestion Ranking
Pro Spring MVC has a massive community
Being the oldest and most used JVM web framework, means that Spring MVC has a massive community of followers who are very helpful and have provided numerous tutorials and answers on SO.
Spring even holds an annual conference called SpringOne. The Spring forums and SO are great places to ask and get help about anything Spring related. The website blog and newsletter keep developers informed on every news related with the framework.
Pro Spring apps are highly scalable
Applications are meant to scale as the framework is used in large-scale applications worldwide. Components like EhCache are used to scale memory cache and it also contains components used for parallel processing.
Batch enables processing of large volumes of records and job processing statistics.
Pro Great documentation that covers almost everything.
The official documentation covers virtually everything. The official website also has a series of great tutorials in video and text formats. There are links to Github repositories for Spring sample applications and there are also a lot of third-party tutorials out there for the fact that Spring MVC is so widely used by many experienced developers.
Pro Spring has an extensive ecosystem
It is based and is dependent on the Spring Framework, therefore it benefits from tools like for example Roo and Spring Tool Suite and many more tools included in the Spring Framework. All Maven dependencies are available in a public Maven repository.
There are also 3rd-party solutions for Spring, such as MyEclipse which includes scaffolding capability for Spring MVC.
Pro More than 900 plugins
Grails is a full-stack web framework, not just MVC. It contains a lot of stuff out of the box, but it doesn’t enforce it. It contains over 900 plugins which provide a Groovy API for a lot of useful and well-known Java libraries. And what is more important is that they are super easy to install!
Pro Very fast setup and scaffolding
Setting up a new project is quite fast and code generation (scaffolding) saves you a lot of time. It also uses a convention over configuration principle which helps you bypass all the configuration trouble.
Grails also comes with a reloading mechanism out of the box.
Pro Easy to use
Grails is designed to be a rapid development framework with a straight learning curve. It advocates convention over configuration. Extensibility is very simple when using plugins (there is a lot of them). One command in the console – and all the dependencies and configurations are managed for you.
Pro Grails is highly scalable
Grails is an abstraction over Spring and Hibernate. This makes Grails applications fast and scalable. This is because both Spring and Hibernate are themselves scalable.
Pro Great UI design alternatives
Pro Great documentation and community
The Documentation section is actually a wiki, which can be modified by any logged in user. It has an official manual, tutorials, screencasts, a sample app and much more. If that does not do it for you, then there are countless third-party tutorials, more than 12k questions on SO and much much more
Con Lacking in UI development
While actually very good and with a very complete and rich feature set to develop and maintain code on the server side, it still doesn't provide any rich framework for building good user interfaces.
Con Updating and code maintenance can be a grueling task if you are a beginner.
Updating your project is manageable if you’re already familiar with the framework and the project itself, but if you’re just diving in it can be a little overwhelming and hard.
Con Complex and not newbie friendly
Spring MVC architecture although simple has a lot of layers and abstractions which can be hard to debug if problems arise. It is also highly dependant on the Spring core.
It's an old and mature framework that has numerous amount of ways to extend and configure it – and this actually makes it fairly complex.
Con Bloated legacy DI API
Spring DI is bloated and rather complex in comparison to CDI.
Con Slow Prototyping
If you are looking to build a quick prototype fast and easy, Spring isn't going to help much. It's very large and quite hard to grasp if you are just beginning with it.
Con Grails is a fairly complex framework
Grails is a pretty heavy piece of software. It's functionality is covered by GORM (Grails' Object Relational Mapping) which is a facade for hybernate and by Spring MVC.
Everything is glued by core Spring and furthermore, Grails adds another level of abstraction on top of all this. These things may create some trouble down the road when debugging.