What are the pros and cons of the assorted Java web frameworks? [closed]
Asked Answered
D

24

85

I am considering creating my own website using Java and am trying to decide what framework to use. However, doing a quick search for Java frameworks returns more than 50 to choose from!

My website is just going to be for my own enjoyment of building it in the beginning, but if it becomes popular, it would be good for it to have some scalability, or to at least be able to redesign for that.

What are the main differences between the more popular frameworks? Are there instances where one significantly outperforms the others? For example, high-traffic enterprise applications versus low-traffic small applications. I'm also wondering if some are much easier to learn and use than others.

Is there anyone who has experience with some of these frameworks and can make a recommendation? Does the sheer number of choices just serve as an early warning to avoid Java-based web development where possible?

Dysthymia answered 23/8, 2008 at 20:58 Comment(2)
To some degree, this is like saying "doing a quick search for tools returns more than 50 to choose from; should I pick a hammer, a screwdriver or pliers?" Still, with the subquestions, this is a decent "good subjective" question.Rumrunner
"Funny" as usual, extremely useful question and answers (I just ordered book about Wicket, thank you all), but entire post is closed as not constructive. "this question will LIKELY" -- and this dry fact, nothing speculative, oh irony...Tephra
M
59

I've used Tapestry 3, Wicket, Echo, and JSF fairly extensively. I'd really recommend you look those over and pick the one that appears the easiest for you, and to most closely fit the way you prefer to work.

Of them, the most comfortable for me to work with was Wicket, due to the lightweight nature of component building and simplicity of page templating. That goes doubly so if you are using your own db code instead of Hibernate or some other framework (I was never completely happy with Wicket Hibernate or Spring Integration).

Echo is great if you don't mind writing all of your layout in Java. I know that is different now, but I still think that product serves a fairly narrow niche. They change the development model with every major release as well it seems.

Tapestry is a great product, but it is obviously very different from the others in terms of development model as it is led mainly by one dude. Howard Lewis Ship is no doubt quite smart, but I am disappointed with their decision to basically forget backwards compatibility with each release. Again, though, for your needs this may not matter, and I've always found the Tapestry products pleasurable to work against.

JSF has been out for years, and still feels like something that a Struts guy built to fix all of the problems of Struts. Without really understanding all of the problems with Struts. It still has an unfinished feel to it, although the product is obviously very flexible. I use it and have some fondness for it, with great hopes for its future. I think the next release (2.0) to be delivered in JEE6 will really bring it into its own, with a new template syntax (similar to Facelets) and a simplified component model (custom components in only 1 file... finally).

And, of course, there are a million smaller frameworks and tools that get their own following (Velocity for basic needs, raw JSPs, Struts, etc). I generally prefer component oriented frameworks myself, though.

In the end, I'd recommend just taking a look at Tapestry, Wicket, and JSF and just picking the one that feels the best to you. You'll probably find one that just fits the way you like to work very quickly.

Menis answered 23/8, 2008 at 23:39 Comment(4)
If your Web App is content Based like a forum system, I'll suggest you use GWT and Ext-js. If your Web App is more like a desk app like ERP terminal, I'll suggest you use ZK, Echo3, Vaddin and GWT. I wont suggest any JSF solution because without the fact "It's JEE Standard" I found no benefit to use them.Wilfredwilfreda
@Wilfredwilfreda - If your forum needs SEO, you'll find GWT difficult, imo.Menis
JSF is probably overkill for a website, instead I would go for more productive frameworks,... developing should stay fun, and JSF has not been build with 'Fun' in mind :)Schizont
Tapestry, Wicket, JSF and Echo are all component oriented and GWT, Ext-js and Vaadin are Javascript oriented. Don't forget to take a look at all the wonderful "classic" MVC frameworks such as Spring MVC, Play framework, Grails and Stripes. They have a very different programming model from the former ones, but have other sweet spots (this is why there are so many frameworks - different purposes, needs and taste require different tools).Bicentennial
H
39

My favorite is the Spring Framework. With 2.5 Spring MVC is soooo kick ass, with new annotations, convention over configuration features, etc.

If you're just doing something super simple you could also just try using the regular Servlet API and not bother with a framework.

Hasan answered 23/8, 2008 at 21:55 Comment(5)
Up vote for mentioning using regular Servlet API for something simple.Barnie
I would avoid any 'web mvc' framework, for reasons outlined in the (free) first chapter of Wicket In Action. Also, I would avoid using the Servlet API directly unless you have a single page application or you are looking to write your own framework from scratch.Pentachlorophenol
I like Spring too, but I found all the configuration only pays off if you are writing a mahoosive application.Judgment
There is barely any configuration using annotations.Hasan
@Hasan The annotations merely place the configuration in your java classes instead of xml.Wellspring
B
25

I recommend the component oriented Wicket framework. It allows you to write your web application in plain old Java code, you can use POJOs as the model for all components and don't need to mess around with huge XML configuration files.

I had successfully developed an online banking application with Struts when I discovered Wicket and saw how easy web application development can be!

Brister answered 25/8, 2008 at 21:16 Comment(0)
M
17

I've recently started using the Stripes Framework. If you're looking for a request based framework that's really easy to use, but doesn't impose any limits on what you are doing I'd highly recommend it.

It's similar to struts, but it goes way beyond it. There are even some plugin projects that enable you to do use hibernate or jpa with very little configuration.

There are a lot of good frameworks out there though I've heard wicket is a good one as well, but I haven't used it.

Midmost answered 25/8, 2008 at 14:4 Comment(0)
P
16

Haven't tried it myself, but I think

http://www.playframework.org/

has a lot of potential...

coming from php and classic asp, it's the first java web framework that sound promising to me....

Plumber answered 25/10, 2009 at 19:8 Comment(1)
it's funny that its fifth time today that I saw "I havent't used it, but I recommend Play" here on stackoverflow.Nabors
S
11

UPDATE: Tapestry 5.2 is out, so it's not abandoned, as it previously appeared to be. My experience is with Tapestry 4, not 5, so your mileage may vary. My opinion of Tapestry has changed over the years; I have modified this post to reflect it.

I can no longer recommend Tapestry as I did previously. Tapestry 5 appears to be a significant improvement, but my main issue with Tapestry is not with platform itself; it's with the people behind it.

Historically, every major version update of Tapestry has broken backwards compatibility with extreme prejudice, far more than one might expect. This seems to be due to the incorporation of new coding techniques or technologies that require significant rewrites.

Howard Lewis Ship (the principal author of Tapestry) is certainly a brilliant developer, but I can't say I care for his management of the Tapestry project. Development of Tapestry 5 began almost immediately after Tapestry 4 shipped. From what I can tell, Ship pretty much devoted himself to that, leaving Tapestry 4 in the hands of other contributors, who I feel are not nearly as capable as Ship. After having made the painful switch from Tapestry 3 to Tapestry 4, I felt that I had been abandoned almost immediately.

Of course, with the release of Tapestry 5, Tapestry 4 became a legacy product. I wouldn't have a problem with this if the upgrade path wasn't so brutal again. So now our development team is in the rather unenviable position: We could continue to use an essentially abandoned web platform (Tapestry 4), make the heinous upgrade to Tapestry 5, or give up on Tapestry entirely and rewrite our application using another platform. None of these options is very attractive.

Tapestry 5 is supposedly written so as to reduce the likelihood of update breakage from this point forward. A good example is in the page classes: in previous incarnations, page classes descended from a base class provided by Tapestry; incompatible API changes in this class were the cause of a large number of backward compatibility problems. In Tapestry 5, pages are POJOs which are enhanced at runtime with the "magic Tapestry fairy dust" via annotations. So as long as the contract for the annotations is maintained, changes to Tapestry won't affect your page classes.

If this is right, then writing a new application using Tapestry 5 could turn out well. But personally, I don't feel like putting my hand on the burner again.

Suricate answered 2/9, 2008 at 18:20 Comment(3)
Update: As time has gone on, the Tapestry project appears to have been abandoned. There have been no Tapestry 5 releases since April '09, and Tapestry 4, still with a bunch of outstanding bugs in their JIRA, has not had an update since '08. Because of this, I can no longer recommend Tapestry as a viable choice for a web application framework.Suricate
Tapestry has not been abandoned. The Tapestry 5 branch is fairly active with 5.1 as the stable option and 5.2 coming soon.Franciscka
You are right. In fact, Tapestry 5.2 has since been released. I've updated the post to reflect my updated opinion of Tapestry.Suricate
L
9

Disclamer: I work at Vaadin (previously IT Mill)

If you are doing something RIAish, you might want to take look at Vaadin. It's an open source UI-oriented AJAX framework that, to me, is nice to use (I come from a PHP background myself).

There's a case study that compares doing the same application (i.e. two applications with the same set of features) in Icefaces and Vaadin. In a nutshell, it states that the UI development was considerably faster.

Even though the study is hosted at the company's wiki, I can assure that it's objective, genuine and truthful, although I can't force you in believing me.

Levona answered 23/8, 2008 at 21:19 Comment(1)
+1 The framework is re-branded as vaadin (previously ITMill). I have to say vaadin is a very nice looking web framework and all java nothing else. I find it very productive.Merrile
E
7

After a long while of testing various solutions, for me it turned out to be:

  • Spring MVC for the presentation and controller layer (NO Spring Webflow though, because my flows are based on ajax)

  • jQuery for all the client side stuff

  • Spring Security for the, well, security aspect

  • Hibernate / JPA2

  • Jetty for the sake of continuations (comet)

One month of an extraordinarily steep learning curve, but now I am happy.

I would also like to mention that I was just a little step away from skipping all that Java stuff and learing Scala/LIFT instead. As far as I am concerned, everything in Java that is related with cutting edge web development (comet, async communication, security (yes, even with Spring Security!)) still is a bit of a hack (proove me wrong by evidence, pleeease!). To me, Scala/LIFT seems to be a more out-of-the-box and all-in-one solution.

The reason why I finally decided not to go with Scala is

  • as a project leader I must consider human resources and Java developers are much easier to find than Scala developers

  • for most developers in my team, Scala's funcional concept, as excellent as it is, is hard to understand

Cheers Er

Epididymis answered 3/8, 2010 at 7:21 Comment(1)
This is all good stuff. Good choice spring MVC, stay on the safe (and wise) side.Proliferate
S
5

I've heard good things about the Spring Framework too. In general, though, I've been underwhelmed by most Java web frameworks I've looked at (esp Struts).

For a simple app I'd definitely consider using "raw" servlets and JSPs and not worry about adopting a framework. If the servlets are well written, it should be straightforward in the future to port to a framework if necessary when the app grows in complexity.

Slave answered 23/8, 2008 at 23:10 Comment(1)
+1 for "If the servlets are well written ..."Montez
H
5

My pick is Wicket!!

Hypocotyl answered 24/2, 2009 at 9:44 Comment(0)
I
4

All of them - that's the problem ;-)

Individually answered 26/9, 2008 at 11:36 Comment(0)
C
3

I think for your modest requirements, you just need to code up servlets or simple jsp pages that you can serve from Tomcat server. I dont think you need any kind of web-framework (like struts) for personal web-site data

Clytemnestra answered 23/8, 2008 at 21:40 Comment(0)
P
3

Saying "use JSF" is a little to simple. When you decide to use JSF, you have to choose a component library on top of it. Will you use MyFaces Tomahawk, Trinidad, Tobago (http://myfaces.apache.org/)? Or maybe ICEfaces (http://www.icefaces.org/)? Oh, and if you use ICEfaces, will you use JSPs or Facelets for your views?

In my opinion it is to hard to tell. Nobody has the time to evaluate all the promising alternatives, at least in the projects I work on, because they are not big enough to do three month evaluation phases. However, you should look around for some that has a big and active community and isn't gone in a year. JSF is around for some time, and since it gets pushed by sun, it will be around for some more. I can't say if it's the best choice, but it will be a good one.

Patin answered 24/2, 2009 at 10:23 Comment(2)
Jsp was a pain for me when doing a Web app we sell. An Update Will consider facelets instead.Wantage
Ya, by this time I'am pretty sure: use facelets instead of JSP. It is much better and I don't see any (big) disadvantages.Coloratura
C
3

http://zkoss.org - the good one

Chore answered 9/9, 2009 at 13:38 Comment(0)
M
3

For high traffic sites I'd use a framework that doesn't manage client state on the server - Wicket, JSF and Tapestry are managing client state on the server. I'd only use those frameworks (Wicket is my favourite) if the application should be more like a desktop application. But I'd try to use a more scalable and simple REST+AJAX approach though.

Spring MVC would be a candidate, but since Spring MVC 3 it has a strange annotation overloaded programming model which doesn't use the benefits of static typing. There ore other ugly things like output parameters in methods combined with a usual return, so there are two output channels of one method. Spring MVC also tends to reeinvent the wheel and you'll have more to configure compared to other frameworks. I cannot really recommend Spring MVC though it has some nice ideas.

Grails is a convenient way to use Spring MVC and other established frameworks like Hibernate. Coding is fun and you'll quickly see results.

And don't forget that the Servlet API with a few little helpers like FreeMarker for templating is very powerful.

Micromho answered 30/12, 2009 at 10:8 Comment(0)
S
3

I have evaluated quite a few frameworks and Vaadin (http://vaadin.com/home) has percolated all the way to the top.

You should at least give it a short evaluation.

Cheers!

Stockdale answered 27/7, 2010 at 16:17 Comment(0)
P
2

My pick would be Wicket (for large projects and a predictable user base), GWT (for large projects that are mostly public facing) or just a service framework (like Jersey/ JAXRS) together with a JavaScript toolkit (for small to medium projects).

Pentachlorophenol answered 31/1, 2010 at 23:30 Comment(0)
M
2

I recommend Seam, especially if you need persistence.

Matchmaker answered 6/3, 2010 at 17:48 Comment(0)
F
1

See a few comments on some Java application Frameworks (second paragraph):

http://swiss-knife.blogspot.com/2009/11/some-java-application-servers.html

Fontanez answered 2/8, 2010 at 17:48 Comment(0)
A
1

For quick and fancy GUI you can use JSF with Richfaces library. Richfaces UI components are easy to use and handy references available with code demonstration in the demo site. Probably later when your site has more data to handle and lot of information has to be transacted in database you can plug any database access framework (ORM) with it.

Astera answered 15/4, 2011 at 13:2 Comment(0)
P
0

Can't believe no one has mentioned GWT

Paolapaolina answered 11/9, 2008 at 4:43 Comment(2)
I wouldn't really consider GWT a web application framework really (it's more like a web toolkit, hence the name). GWT is great however, and goes well along with Spring for example.Fingering
framework or toolkit, what's the concrete difference really? Coding with GWT feels just as much working with a framework as the other options.Pentachlorophenol
T
0

My favorite way to go for really simple apps is Apache VelocityTools (VelocityLayoutServlet) with Velosurf (http://velosurf.sourceforge.net).

For more complex apps, Spring MVC or Struts 2.

Thickness answered 15/9, 2008 at 16:3 Comment(0)
J
0

Try HybridJava - that is much simpler than anything else.

Jambalaya answered 28/7, 2010 at 5:32 Comment(1)
hybridserverpages.comPlumber
M
0

I would say vaadin or wicket

Merrile answered 8/2, 2011 at 11:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.