简体   繁体   English

我应该在jQuery中使用Struts 1还是2?

[英]Should I use Struts 1 or 2 with jQuery?

I want to develop a Java EE application with a rich user interface which uses Ajax heavily. 我想开发一个具有丰富用户界面的Java EE应用程序,该应用程序大量使用Ajax。 I know that I can use Ajax frameworks like jQuery and Dojo to achieve this. 我知道我可以使用jQuery和Dojo之类的Ajax框架来实现这一目标。 I have worked previously on Java EE with Struts (1.x) and Hibernate. 之前,我曾在Struts(1.x)和Hibernate上进行过Java EE的研究。

But recently I found that Struts 2 has inbuilt Ajax support. 但是最近我发现Struts 2具有内置的Ajax支持。 Is it worth it to use Struts 2? 使用Struts 2是否值得? I am not familiar with Struts 2. Should I go with Struts 1 or 2? 我对Struts 2不熟悉。我应该选择Struts 1还是2? If I use Struts 2 will I have to use jQuery also or does Struts 2 have custom tags that support Ajax? 如果使用Struts 2,我是否也必须使用jQuery,或者Struts 2是否具有支持Ajax的自定义标签?

Next to Struts 2, you should maybe consider JSF 2. This is a very good web framework that has great build-in support for Ajax as well. 在Struts 2旁边,您可能应该考虑使用JSF2。这是一个非常好的Web框架,它对Ajax也具有强大的内置支持。

There are lots of component libraries that are a good showoff of how AJAX can be used in JSF, eg see the PrimeFaces Showcase . 有很多组件库很好地展示了如何在JSF中使用AJAX,例如,请参见PrimeFaces Showcase

Use Struts 2, Struts 1 is extremely antiquated. 使用Struts 2,Struts 1非常陈旧。 Struts 2 is considerably different from Struts 1 though, so your knowledge of Struts 1 probably won't transfer much (except for general purpose understanding of the servlet request / response life cycle, etc). 但是Struts 2与Struts 1有很大的不同,因此您对Struts 1的了解可能不会转移太多(除了对Servlet请求/响应生命周期的一般性了解,等等)。 There's a Struts 2 JQuery plugin that you can use for Ajax. 有一个Struts 2 JQuery插件 ,可用于Ajax。 Don't use the Dojo ajax support, it's deprecated. 不要使用Dojo ajax支持,它已被弃用。

Struts2。您将必须使用jquery(不仅是helper标签)。

You should use GWT. 您应该使用GWT。 Seriosly. Seriosly。 Struts is good, but nothing beats GWT if your goal is Ajax. Struts很好,但是如果您的目标是Ajax,那么GWT不会胜过GWT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM