简体   繁体   English

Struts2插件 - Dojo或jQuery还是......?

[英]Struts2 plugins - Dojo or jQuery or…?

Since Apache Struts has deprecated Dojo plugin from Struts 2.1.x I am thinking to change everything to jQuery. 由于Apache Struts已经弃用了Struts 2.1.x中的Dojo插件,我正在考虑将所有内容更改为jQuery。 I especially noticed the difference in sizes (170kb vs 19kb - something like that). 我特别注意到尺寸的差异(170kb vs 19kb - 类似的东西)。 I had troubles with IE browser with handling dojo scripts, is this happening also with jQuery (when user is working with the application for a long time, script stops running)? 我在处理dojo脚本的IE浏览器时遇到了麻烦,这种情况也发生在jQuery上(当用户长时间使用应用程序时,脚本停止运行)?

I have a lot of dojo tags in my applications, and I use most of theirs attributes. 我的应用程序中有很多dojo标记,我使用了他们的大多数属性。

Has anyone had any experience doing that? 有没有人有这方面的经验? What were the problems? 有什么问题? What were the benefits? 有什么好处? Downsides? 缺点?

Does anyone has any better ideas of which plugin to include with Struts2? 有没有人对Struts2中包含哪个插件有更好的想法?

Any answer will be great! 任何答案都会很棒! Thanks. 谢谢。

best to use the struts2-jquery plugin found here 最好使用这里找到的struts2-jquery插件

code.google.com/p/struts2-jquery-plugin/ code.google.com/p/struts2-jquery-plugin/

I would suggest jQuery. 我会建议jQuery。 I had the same problem working on a project the used Dojo, but found it to be so intrusive I switched to jQuery. 我在使用Dojo的项目上遇到了同样的问题,但发现它是如此干扰我切换到jQuery。 With jQuery it's a lot easier to use as it only used the standard HTML markup instead of adding it's own tags like Dojo does. 使用jQuery它更容易使用,因为它只使用标准HTML标记而不是像Dojo那样添加自己的标记。 I also found a ton more documentation for jQuery then Dojo as well as some good guides on overcoming the IE6 crap we still have to code for. 我还发现了更多关于jQuery然后Dojo的文档,以及一些关于克服我们仍然需要编写代码的IE6垃圾的好指南。 All in all I would highly recommend jQuery over Dojo in any project. 总而言之,我强烈建议在任何项目中使用jQuery而不是Dojo。

Cheers 干杯

While migrating to JQuery we can't get same look and feel etc... like in case of autocompleter. 在迁移到JQuery时,我们无法获得相同的外观和感觉......就像自动完成程序一样。 Below are things missing in the default jquery autocomplete: 以下是默认jquery自动完成中缺少的内容:

  1. Rows with alternate shades of light and dark gray 具有交替色调的浅灰色和深灰色的行
  2. Matches from starting key only, at present it searches with matching key from whole keyword 仅从起始键匹配,目前它使用整个关键字中的匹配键进行搜索
  3. To show combobox with down error 显示具有向下错误的组合框

With dojo Plugin I have massive Problems with AJAX and File Uploads and JavaScript in AJAX Results. 使用dojo插件,我在AJAX结果中遇到了AJAX和文件上传以及JavaScript的大量问题。

With Struts2 jQuery Plugin it works well for me. 使用Struts2 jQuery插件,它对我很有用。

It has worked fine for me to change the tags from dojo to jquery. 它对我来说很好,可以将标签从dojo更改为jquery。 In my (small)project only a few attibutes had to be changed. 在我的(小)项目中,只需改变几个属性。

The biggest problem for me has been that the tree tag doesn´t exist in jquery so I kept the old dojo tags for that part which has generated alot of conflicts between dojo and jquery. 对我来说最大的问题是jquery中不存在树标记,所以我保留了那个在dojo和jquery之间产生了很多冲突的部分的旧dojo标记。 So I recommend that you should change ALL tags at once to jquery to avoid strange behavior. 所以我建议您应该立即将所有标签更改为jquery,以避免出现奇怪的行为。

JQuery and Dojo both are competent and very much rich in the functionalities.Both the framework has their own architectural strenghs. JQuery和Dojo都很有能力并且功能非常丰富。框架都有自己的架构强度。

The first stable version of dojo 0.4 came up early and struts included dojo. dojo 0.4的第一个稳定版本提前出现,struts包括dojo。 Later on Jquery came up with lightweight and stable version, which suited better with Struts plugin based architecture. 后来Jquery提出了轻量级和稳定版本,它更适合基于Struts插件的架构。 While dojo architecture had its own trajectory from 0.4 to 1.0-> 1.4 and struts2-dojo plugin made deprecated. 虽然dojo架构有自己的轨迹从0.4到1.0-> 1.4并且struts2-dojo插件已被弃用。

Both the Javascript libraries are very well maintained, enhanced and supported by community. 这两个Javascript库都得到社区的良好维护,增强和支持。 It's just jquery which glues well with struts2 at the moment. 这只是jquery,目前与struts2很好地融合在一起。

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

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