开发者

Where JSF and struts2 fails/goods

开发者 https://www.devze.com 2022-12-21 05:00 出处:网络
I am begining a web system and can\'t decide what technology use! Struts2 and JSF (with jboss seam) are a nice choices, but I can\'t decide which\'s better. In JSF have some that I don\'t like, maybe

I am begining a web system and can't decide what technology use! Struts2 and JSF (with jboss seam) are a nice choices, but I can't decide which's better. In JSF have some that I don't like, maybe its "paradigm" no action like. And Struts2, the peoples here don't use more.

The system is a map collaborative web 开发者_如何转开发site.


I have used both Struts2 and JSF extensively, both are good but I would still recommend JSF. Here is why.

  1. More users. Yes this counts; more people means its easier to get hands on new programmers.
  2. Better tool support. IDEs like IntelliJ have very good JSF support.
  3. Facelets. Lets face it, JSP sucks. You simply should not be allowed to write business logic inside your view code. Keeping your views in XHTML ensures that they are clean and tidy.
  4. Documentation/Books. This might have changed, but when I was in the struts2 camp (2007/2008) the books available was few and of very poor quality. There is a good choice of JSF/Seam books.
  5. JSF2/Seam. JSF2 is very nice (and IntelliJ 9 supports it). New scopes, such as the view scope, are really helpful (fx. if you are having a long running conversation in a flow).

If you are interested in some of the newer features in JSF2 then checkout this blog post. Also you might want to check out Stripes, it is also a very nice server side web framework and finally here is a very thorough (and a little old) comparison of most Java web frameworks.


This a very debatable topic. I think the main advantage of Struts2, compared to JSF, is its simplicity, it is much easier to grasp. Specially for beginners in web programming, or those familiar with "action based" web frameworks (Struts 1, Webworks, Spring MVC, Stripes). But Lars Tackmann's points are valid (though Struts2 does not force you to use JSP; and indeed it uses FreeMarker internally). It's true that Struts2 has not attained a big user base, the community (both users and developers) does not seem to be very active, and that is a big minus. JSF also has its shortcomings, I've heard (I've not used it)... as every Java web framework, it seems.

0

精彩评论

暂无评论...
验证码 换一张
取 消