7
votes

I'm looking for what view technology would be considered the best approach for Spring MVC 3.0 which is flexible, maintainable and allows multiple rendering technologies such as HTML, PDF etc...

We're looking to develop our next web application using Spring MVC 3.0 and have settled on Hibernate for persistence but are still trying to decide which is the most appropriate view technology.

We will require support for PDF reports but would most likely write these using iText.

Are there any maven archtypes which would setup a recommended application complete with persistence and view technology?

The spring samples use a bunch of different technologies from JSTL to Apache Tiles, we've only ever used JSP in the past since we moved to .NET in 2003 and are moving back to Java now.

5

5 Answers

10
votes

There's really nothing wrong with using JSP, if you use the most recent version. You can certainly choose Freemarker, Velocity and other cool viewer, but if your entire team is already comfortable dealing with JSP, you need to take account of your project deadline and all the learning curves when taking on a new technology. If it makes sense, sure, it doesn't hurt to learn another new thing.

In my case, I use JSP with Sitemesh as my template. I used JSP/Strut Tiles combo for quite awhile but I find the template to be too intrusive, Sitemesh seems to be more seamless to me because it doesn't clutter my actual JSP files with some Tile specific custom tags.

1
votes

Below are a few.

  • Freemarker
  • Apache velocity
  • JSP (the new 2.1 alright with improvements like functions, simplified custom tags, etc.) with apache tiles

Here is a doc that talks about integration with view technologies

We are currently using Jsp 2.1 with spring webmvc 3.0x with apache tiles on google appengine and it servers our purpose quite well.

0
votes

How about Apache Velocity

That's the most popular template engine I know of. Would like to get more suggestions though.

Update:

Freemarker is another

Source

0
votes

If I were you, I would stick with jsps for now. You can mix and match your views in Spring if you decide certain flows will require something else. For example, you will need to use different view types if you plan to use any ajax style processing.

0
votes

JSP : easy to use and maintain.

Other are Apache Velocity, Freemarker.

I personally would recommend JSP