the best java web framework

8

Click here to load reader

Upload: pradeep-kumar-s

Post on 18-Apr-2017

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Best Java Web Framework

Altabel Group's Blog

Entries (RSS) Comments (RSS)

The Best Java Web Framework

Posted by: altabel on: October 17, 2012

In: Java 23 Comments

Java has been around for a while. Soon a&er its initial inception, Sun started to push the platform towardsthe web. Now many years later, there are dozens of web frameworks and every now and then the samequestion pops up: which Java web framework is best.

No framework is perfect, they all have their merits and they all have their breaking points. There is not asingle web framework out there that will work for all requirements out there, still there could be foundarguments why one framework is be.er than others and for what types of applications. So let’s have alook at most viable Java web frameworks:

Servlets and JSPs

Some developers say that JSP technology is seriously outdated, while others see it from a li.le other pointof view. The fact of the ma.er is that Servlets and JSPs do nothing for you – you do everything includingmapping request parameters to objects and validating them.

Even with a big variety of frameworks out there, there is still a place for Servlets & JSPs. Smaller webapplications are still quickly and cleanly built using them and you don’t need any external dependencieseither. The only side note is that you do it properly, which means using Servlets to invoke business logic,using JSPs to generate the view and having JSPs contain no Java code, only JSTL tags and if you wantcustom tags.

Pros: good for a few pages/functions to implementCons: outdated

Javaserver Faces

Some hate it, some love it. The main reason most people hate it is its steep learning curve and the fact thatpeople use it for all the wrong purposes. Speaking of the right purpose, JSF is primarily aimed at beingused to build web components for enterprise applications. It is excellent for creating complex userinterfaces as the framework takes care of wiring UI components to backend classes with automatedvalidation and transformations going on. Due to its stateful nature you even have an object representationof the web UI available to you server side.

About these ads

The Best Java Web Framework | Altabel Group's Blog http://altabel.wordpress.com/2012/10/17/the-best-java-web-framework/

1 of 8 10/10/2013 4:52 PM

Page 2: The Best Java Web Framework

JSF itself is only the base actually. It is designed to be extended, and many third parties do just that. Ontop of JSF you also have JBoss, Richfaces, Icefaces, Primefaces, Oracle ADF, Apache Tomahawk, JBossSeam, Omnifaces, etc. They all share the fact that they extend core JSF with more functionality, whichusually comes in the form of Ajax controlled “rich internet components”. Jboss Seam is unique in that listas it does not actually aim to extend, but “seamlessly wire together” many frameworks and technologiesto the enterprise platform.

Pros: Good for medium to complex enteprise webapps where full control over the front end is not arequirement. If the application is built and designed around a solid backend, JSF 2.1 is your friend.Cons: Not an easy material. JSF is hard, and there isn’t rich online documentation. If your application aimsaround a rich and dynamic web 2.0 front end, JSF is not your friend.

Spring framework

Spring framework is not quite a ‘web framework’, but it is unique. IT shares JBoss Seam’s aim in wiringtogether many different technologies, both frontend and backend. You can use it as an alternative to JavaEnterprise Edition technology, but you are just as free to wire Spring and JEE technologies into the sameapplication.

So what does Spring offer itself? A bunch! It has a bean autowiring system to replace (or extend) thedependency injection model as it exists in the JEE specification. It also has an incredibly strong securitymodel. Additionally instead of manually constructing objects, you “inject” them from a Spring managedcontext. Next Spring has a strong emphasis on the Model View Controller pa.ern. Spring provides defaultcontroller types for example, but you can also implement your own. As for the model layer the frameworkcan setup JDBC, Hibernate, JPA, etc. for you and it can even manage the sessions and transactions. Andfinally it offers a built in web front end framework with easy to use annotations. I guess there is muchmore to add to this.

Pros: Excellent for building and maintaining large enterprise applications that also target other legacysystems and technologies. Spring is so flexible you’ll have the least trouble adapting it to whatever youalready have floating around. Also there is a huge community around Spring.Cons: Clunky due to its hugeness. There is also a big amount of legacy that the framework has to dragaround.

Struts 2

Struts 2 is actually quite a clean and neat framework. If all you want to do is create simple webapplications, “web 2.0″ or otherwise, then it isn’t a bad idea at all to consider Struts 2. But it haslimitations. The security model is weak. In this world of web heightened security demands, the frameworkdoes nothing to assist you or to help you prevent doing it wrong.

Pros: Good for web applications that do not have high security demands but will be a mix of complexforms and dynamic frontend pages. Low learning curve.Cons: Weak security

Wicket

A Wicket application, although targeting the web, develops like a Swing application. You work withcomponents instead of a “backend and a frontend”. The separation between the two layers is almosttaken away by Wicket. Instead you think in events. A user presses a bu.on, what is supposed to happen?Anything you would basically do with Javascript using other frameworks, in Wicket you write it all using

The Best Java Web Framework | Altabel Group's Blog http://altabel.wordpress.com/2012/10/17/the-best-java-web-framework/

2 of 8 10/10/2013 4:52 PM

Page 3: The Best Java Web Framework

Java code. That is because it all happens server side, but the framework makes it seem like it all happensclient side.

Wicket is also friendly to the developer. It integrates nicely into IDEs and even has built in support forhot-deployment making it far easier to change and debug your applications. Also boring and cumbersomefeatures like making your application multilingual is made incredibly easy.

Pros: Wicket can handle most webapp needs including those that are oriented on the back-end and thosethat are oriented on the front-end.Cons: Weak documentation (including the books); the alternative API design.

GWT

GWT offers incredibly powerful browser user interface capabilities; using it you can create the coolest webfront ends with relatively li.le work. Google creates most of its own online web services using GWT.On top of GWT itself Google also provides you a wide range of tools, for example a rich set of plugins forEclipse. This makes it a complete package that is completely carried by Google itself. This keeps it alltightly integrated and documented, which is a big plus for a web framework.

An added bonus of GWT is its Java to Javascript conversion capabilities. The HTML 5 madness has begunand people are now actually writing whole applications in Javascript. Through GWT you don’t actuallyhave to write your stuff in Javascript itself; you can write Java code instead and still end up with HTML 5components.

Pros: Good to create highly complex and feature rich web user interfacesCons: The framework is different from any other framework out there. When you want to use it you startfrom scratch, so it may make it hard to adopt it for a new project.

Play Framework

This framework is relatively young. It lays down the rules, brings the conventions and provides you thefoundation to allow you to quickly and painlessly develop web applications, without boilerplate,dependency conflicts or layer upon layer of configuration.

This framework can utilize the benefits of the Scala language (but it is also built for the Java language). Thesame is true for Play 2.0 which is out right now, and more so. This is mostly because the framework ismodeled almost entirely a&er Ruby on Rails 3 including the available tooling.

Pros: stripping away the boring part of Java web development; being completely stateless andRest-enabled; providing perfect hot-deployment without need for JRebel or JPA entities; integrates withmany popular and important web technologies; manages dependencies for you without needing to learnthe complexities of Maven; consolidates web dev into a neat package; incredibly easy ORM model basedon Hibernate and JPA 2.0, with an additional layer that takes away the cumbersomeness.Cons: The programming model is quite counter-intuitive; navigation is based on throwing exceptions.deploying is a bit of a mess using Play as you don’t deploy classes, you deploy the source files. The(alternative) way you manage a Play project makes it difficult to integrate it in for example a JEEapplication in a way that is easy to maintain.

For sure there are many, many more frameworks to be discussed, but most of them serve the samepurpose. Could you pass out your personal recommendation what frameworks is be.er to use and forwhat types of application?

The Best Java Web Framework | Altabel Group's Blog http://altabel.wordpress.com/2012/10/17/the-best-java-web-framework/

3 of 8 10/10/2013 4:52 PM

Page 4: The Best Java Web Framework

Thanks a lot in advance for sharing your advice!

Kind regards,Aliona Kavalevich – Business Development Manager (LI page)[email protected] Group – Professional So"ware Development

Tags: Apache Tomahawk, GWT, Hibernate, HTML5, Icefaces, Java web framework, JavaScript, JavaserverFaces, JBoss, JBoss Seam, JDBC, JEE technologies, JPA, JSF, JSPs, Omnifaces, Oracle ADF, PlayFramework, Primefaces, Richfaces, Ruby on Rails, Scala, Servlets, Spring, Struts 2, Swing, Wicket

23 Responses to "The Best Java Web Framework"

1 | AlexOctober 19, 2012 at 5:19 am

Have a look at HybridJava as well! That is what surpasses JSP and Struts.

Reply2 | CesarOctober 24, 2012 at 10:14 am

Should consider Grails in the analisys. It is a great Web framework.

ReplyAlionaJanuary 29, 2013 at 11:34 am

got it Please have a look at h.p://altabel.wordpress.com/2012/11/20/what-are-the-grails-advantages-over-other-java-web-frameworks/

Reply3 | MarcusOctober 26, 2012 at 10:20 am

The Best Java Web Framework | Altabel Group's Blog http://altabel.wordpress.com/2012/10/17/the-best-java-web-framework/

4 of 8 10/10/2013 4:52 PM

Page 5: The Best Java Web Framework

I used a lot of JSF and now using Wicket. It is indeed that JSF is easy to create business apps. Wicket isreally neat to create good looking web apps / websites. The documentation is “poor” but there is a lot toread in the JavaDoc! Wicket has also strong security history!

I prefer Wicket, also a nice one to mention is Vaadin. it’s gaining popularity and it is based on GWT, withVaadin you create an GWT app with backend.

Reply4 | LaurentOctober 29, 2012 at 9:04 am

For a global framework approach, you should also have a look at Telosys ( h.p://www.telosys.org/ ) withits code generator (Eclipse plugin)

Reply5 | About JavaDecember 27, 2012 at 1:03 pm

cool informative article.. thanks for sharing..

Reply6 | srchjoyJanuary 7, 2013 at 3:23 pm

For beginners to this world, which one is good to directly jump-in before evovling to others .

Reply7 | enukeso"wareJanuary 14, 2013 at 9:54 am

amazing article!!! Thanks a lot for sharing infromation

ReplyAlionaJanuary 29, 2013 at 11:36 am

thank you!!!

Reply8 | francoisFebruary 4, 2013 at 10:29 am

Hi,For me, Wicket is the best java web framework.

Wicket is far ahead in term of OO programming model, has an easy learning curve, is component oriented,everyting can be tested, has great community, has already 8 books h.p://wicket.apache.org/learn/booksand has a great community h.p://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html.

Francois M

Reply

The Best Java Web Framework | Altabel Group's Blog http://altabel.wordpress.com/2012/10/17/the-best-java-web-framework/

5 of 8 10/10/2013 4:52 PM

Page 6: The Best Java Web Framework

9 | RobFebruary 5, 2013 at 1:23 am

Spring as a whole is not a Web Framework but Spring MVC and Spring WebFlow both are. It is a shameyou didn’t assess them rather than bringing Core Spring into the article..

ReplyAlexFebruary 7, 2013 at 9:17 am

Spring MVC is nothing more than a can of old garbage. It contains stone age items like Velocity,FreeMarker and Struts 2. Nothing of its own.

Reply10 | LukeFebruary 12, 2013 at 7:56 pm

Consider Apache Wicket as a powerful java web framework.It’s efficient, very well wri.en, and last but not the least it’s fun !Luke

Reply11 | AndersMarch 4, 2013 at 8:35 am

I see that struts 2 is labeled with “weak security”. What is the weak security parts about it ? I know it hadproblems with OGNL and you could have it executing arbitrary code, but those problems are now fixed.So i just am curious about how you have landed on the “weak security” conclusion ?

Reply12 | Steve ZodiacApril 5, 2013 at 12:01 pm

Very good post. I used to program .Net (2002-2006), then J2EE with Struts,Eclipse,Ant (2006-2008) andfinally back with .NET since 2008. I have to admit that Java framework are over-complicated comparedwith .NET. I don’t think I’ll ever go back with Java and it’s sad because it is the language with which Ireally learned OOP. The good thing is that C# is so close to Java that I feel like home now.

Reply13 | CostasApril 16, 2013 at 1:52 pm

I have used various java web techs for the last 7 years. I can say only one thing.. there is no holy grail andno one will be!! That said each framework has pros and cons. It depends on what you want to build. Haveyou seen a painter using just a single type of brush?The more experience you get the more you understand. The more you understand the more complexproblems you can solve and so on..For example, in our company we are using the ZK framework to build desktop-like business web apps. Itwould be at least silly to use the same framework to build dynamic web pages for our business web site.

@Steve

The Best Java Web Framework | Altabel Group's Blog http://altabel.wordpress.com/2012/10/17/the-best-java-web-framework/

6 of 8 10/10/2013 4:52 PM

Page 7: The Best Java Web Framework

I believe that Microso& is not the EVIL. Microso& has contributed many things in the so&ware industry.For example, the ZK framework that we are using has adopted the MVVM (model-view view-model)pa.ern which i think is MS’s invention. But i would advise you not to forget java completely.. you will findher in your way somehow..

Reply14 | ravi tejaApril 29, 2013 at 3:40 am

In my point of view vaadin is be.er frame work because there are sevrel inbulit UI components aredesigned internally and reduces the work of UI designers and every layer is a .java file.

Reply15 | automotive news europe 2013May 6, 2013 at 8:34 pm

Whats up! I just would like to give a huge thumbs up for the nice data you’ve got right here on this post.I shall be coming again to your weblog for more soon.

ReplyAlionaJune 4, 2013 at 12:16 pm

always happy to see you here!

Reply16 | will824May 22, 2013 at 9:35 am

Excellent article Aliona, thanks for sharing this valuable information in a very clear way.

Reply17 | prince2 methodologyJune 5, 2013 at 4:41 am

A&er I initially commented I appear to have clicked the -Notify me when new comments are added-checkbox andnow every time a comment is added I get 4 emails with the same comment.There has to be a way you can remove me fromthat service? Cheers!

Reply18 | Iʹm Deany HW (@imdeany)June 5, 2013 at 9:07 am

Great article, Play looks a great FW, but so does Spring, I will look further into GWT, food for thoughtMany thanks

Reply19 | sangndAugust 23, 2013 at 1:43 pm

The Best Java Web Framework | Altabel Group's Blog http://altabel.wordpress.com/2012/10/17/the-best-java-web-framework/

7 of 8 10/10/2013 4:52 PM

Page 8: The Best Java Web Framework

Useful article, thanks!

ReplyBlog at WordPress.com.

The Albeo Theme.

The Best Java Web Framework | Altabel Group's Blog http://altabel.wordpress.com/2012/10/17/the-best-java-web-framework/

8 of 8 10/10/2013 4:52 PM