请推荐在Spring MVC 3应用程序中使用的视图技术

时间:2023-01-16 15:20:07

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...

我正在寻找哪种视图技术被认为是Spring MVC 3.0的最佳方法,它灵活,可维护并允许多种渲染技术,如HTML,PDF等......

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.

我们正在寻求使用Spring MVC 3.0开发我们的下一个Web应用程序,并且已经确定了Hibernate的持久性,但仍在尝试确定哪种是最合适的视图技术。

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

我们需要支持PDF报告,但最有可能使用iText写这些报告。

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

是否有任何maven archtypes可以设置一个完整的持久性和视图技术的推荐应用程序?

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.

Spring样本使用了从JSTL到Apache Tiles的一系列不同技术,自从我们在2003年迁移到.NET并且现在又回到Java之后,我们过去只使用过JSP。

4 个解决方案

#1


9  

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.

如果您使用最新版本,使用JSP确实没有问题。您当然可以选择Freemarker,Velocity和其他很酷的查看器,但如果您的整个团队已经习惯于处理JSP,那么在采用新技术时,您需要考虑项目的截止日期和所有学习曲线。如果它有意义,当然,学习另一个新东西并没有什么坏处。

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.

就我而言,我使用JSP和Sitemesh作为我的模板。我使用了JSP / Strut Tiles组合很长一段时间,但我发现模板太过于干扰,Sitemesh对我来说似乎更加无缝,因为它不会使我的实际JSP文件与一些特定于Tile的自定义标签混乱。

#2


1  

Below are a few.

以下是一些。

  • Freemarker
  • Apache velocity
  • JSP (the new 2.1 alright with improvements like functions, simplified custom tags, etc.) with apache tiles
  • 使用apache磁贴的JSP(新的2.1可以改进,如功能,简化的自定义标签等)

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.

我们目前正在使用带有弹簧webmvc 3.0x的Jsp 2.1和google appengine上的apache磁贴,它很好地服务于我们的目的。

#3


0  

How about Apache Velocity

Apache Velocity怎么样?

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

这是我所知道的最流行的模板引擎。想获得更多建议。

Update:

Freemarker is another

Freemarker是另一个

Source

#4


0  

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.

如果我是你,我现在会坚持使用jsps。如果您确定某些流程需要其他内容,您可以在Spring中混合和匹配您的视图。例如,如果计划使用任何ajax样式处理,则需要使用不同的视图类型。

#1


9  

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.

如果您使用最新版本,使用JSP确实没有问题。您当然可以选择Freemarker,Velocity和其他很酷的查看器,但如果您的整个团队已经习惯于处理JSP,那么在采用新技术时,您需要考虑项目的截止日期和所有学习曲线。如果它有意义,当然,学习另一个新东西并没有什么坏处。

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.

就我而言,我使用JSP和Sitemesh作为我的模板。我使用了JSP / Strut Tiles组合很长一段时间,但我发现模板太过于干扰,Sitemesh对我来说似乎更加无缝,因为它不会使我的实际JSP文件与一些特定于Tile的自定义标签混乱。

#2


1  

Below are a few.

以下是一些。

  • Freemarker
  • Apache velocity
  • JSP (the new 2.1 alright with improvements like functions, simplified custom tags, etc.) with apache tiles
  • 使用apache磁贴的JSP(新的2.1可以改进,如功能,简化的自定义标签等)

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.

我们目前正在使用带有弹簧webmvc 3.0x的Jsp 2.1和google appengine上的apache磁贴,它很好地服务于我们的目的。

#3


0  

How about Apache Velocity

Apache Velocity怎么样?

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

这是我所知道的最流行的模板引擎。想获得更多建议。

Update:

Freemarker is another

Freemarker是另一个

Source

#4


0  

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.

如果我是你,我现在会坚持使用jsps。如果您确定某些流程需要其他内容,您可以在Spring中混合和匹配您的视图。例如,如果计划使用任何ajax样式处理,则需要使用不同的视图类型。