This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes Web Framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Web Framework" Watch "Web Framework" New topic
Author

Web Framework

Thomas Mcfarrow
Ranch Hand

Joined: Jul 09, 2001
Posts: 137
Its been a while since I did a web application (4 years). I am looking for advice what framework is recommended to use? Typically I used Struts in the past but I haven't kept up on the latest and greatest technologies.

ie. Spring MVC, Struts 2.x?

Also, what would be the best framework to integrate Ajax into? Is AJAX the current "standard" for server side scripting?

Any advice/opinions would be greatly appreciated.

Thanks.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Bear's FrontMan. I love it. Nice, robust, clean. None of the excessive stuff that other frameworks have. Plus its free, open source, fast, and supported by great people.
Thomas Mcfarrow
Ranch Hand

Joined: Jul 09, 2001
Posts: 137
Oh, one other requirement is that it needs a nice plugin for Eclipse to help expedite development.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Thomas Mcfarrow wrote: requirement is that it needs a nice plugin for Eclipse to help expedite development.

That is not a requirement. Frontman is so simple, you don't need no steenking plugin. Its a pure MVC system.

It may be true that other frameworks are so complex and hard to use that you need a plugin, but that's not a requirement of your basic question, rather its a side effect of the choice of a framework.

A requirement should be written as: Framework that is highly productive for developers, either intrinsically easy to use, or has built in crutches and plug-ins to hide its complexity.

Thomas Mcfarrow
Ranch Hand

Joined: Jul 09, 2001
Posts: 137
Hi, thanks for the advice.

I am really familiar with Struts (well 4 years back).

Any secondary suggestions? What is the most widely used framework?

Regards.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

Most widely used is likely to SpringMVC at this point. But it's hard to say exactly.

If you want just a bare-bones, stay-out-of-your way framework, you might like FrontMan; otherwise, not so much. If you want in-your-face affect-every-aspect-of-how-you-code, then Struts2 or SpringMVC will be more to your liking.

Personally, I think JSF is an abomination that needs to be excised like a cancer.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

P.S. Familiarity with Struts1 won't be of much help with Struts2.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
I don't think these "which is the best framework" discussions are all that helpful. So much depends on facts we don't know (like the willingness and ability of the developer(s) to learn new stuff, who will be maintaining the code, what should the role of the framework be as part of the larger app, etc.) that these boil down to little more than personal preference.

That being the case, I'll chip in with my favorite: Stripes. It's built on convention-over-configuration (meaning: if you name classes, fields and methods the right way, then you don't need to specify what should happen to them - it will happen automatically), and for what configuration is needed it uses Java annotations right in the code where stuff happens - no XML like Struts and Spring use.

As to the other frameworks mentioned, my opinions are these: SpringMVC might make sense if you're using Spring anyway, but not otherwise. Struts 1 was great in its time but is now dead. Struts 2 is different, but I don't see it rise much beyond what Struts 1 did. JSF turned off many people in its 1.x incarnation; version 2.x is supposed to be better -particularly if coupled with Seam- but I don't think it'll have a great comeback. FrontMan doesn't do enough for my personal tastes (e.g., no variable binding); I don't want to use several frameworks when I can use Stripes for all of it.


Ping & DNS - my free Android networking tools app
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4659
    
    5

Ulf Dittmer wrote:I'll chip in with my favorite: Stripes.

As Ulf says, its personal choice, and I liked what I saw when I looked at Stripes. Got and read the book cover to cover, and still liked it.

But, when I used it, I didn't like it as much as I wanted or expected. It could have easily been user error (i.e. mine). What turned me to look elsewhere was that the Stripes community was mostly inactive. I did not find timely responses to postings asking for help, the source code was not having bug fixes or new features added, etc. These are important criteria in my requirements, but may not be in someone else's list of requirements.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

Ulf Dittmer wrote:I don't think these "which is the best framework" discussions are all that helpful.

Agreed, which is why I couched my response as: if you are looking for x, check out y. There is no "best" framework for everybody.

That being the case, I'll chip in with my favorite: Stripes.

Ah, yes. I forgot about Stripes. Not a bad choice for a middle-of-the road solution. But it does seem to be losing mind share.

JSF turned off many people in its 1.x incarnation; version 2.x is supposed to be better -particularly if coupled with Seam- but I don't think it'll have a great comeback.

Having to use a second framework to overcome the inadequacies of another doesn't strike me as even approaching reasonable.

FrontMan doesn't do enough for my personal tastes (e.g., no variable binding); I don't want to use several frameworks when I can use Stripes for all of it.

FrontMan2 (in beta) adds some minimal data binding around BeanUtils. But remember, that's what FrontMan is really all about: erring on the side of too little, rather than too much.

There are some other choices worth mentioning:
  • Grails, if you want to lean towards the "Rails way" and want to buy into groovy.
  • Play! which seems to be gaining momentum. Sort of a Grails-like approach with Java versus Groovy. It's interesting in a lot of ways, but may turn some people off as it's not even based on Servlets and JSP (though it will deploy into a Servlet container).
  • Sandeep Awasthi
    Ranch Hand

    Joined: Oct 23, 2003
    Posts: 597
    http://www.slideshare.net/mraible/comparing-jvm-web-frameworks


    Sandeep
    Hussein Baghdadi
    clojure forum advocate
    Bartender

    Joined: Nov 08, 2003
    Posts: 3479

    While Play! smells like fresh air, I never liked its "static" methods.


    Doesn't smells like idiomatic Java coding.
    And I don't like that Groovy is the expression language for the templates. Nothing wrong with Groovy, I just don't like it that much.

    In case you aren't tied to Java frameworks, have you considered JRails (JRuby + Rails)? The expressiveness of Ruby meets the power & benefits of JVM.
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 42374
        
      64
    http://www.slideshare.net/mraible/comparing-jvm-web-frameworks

    Matt Raible has gotten so much flak for the methodology used in this presentation that I would heavily discount any of its conclusions.
    sudhir nim
    Ranch Hand

    Joined: Aug 29, 2007
    Posts: 212

    I would recommend Spring MVC, and with annotations, it's really fun.
    If you want rails like experience, try Grails, Recently I am falling in love with grails. It's quite productive and has lot's of plugins, developing custom tags are piece of cake. Integrates well with Hibernate, JPA, App engine datastore, Hadoop, Mongo DB, Neo4j. Security plugins makes life easier.

    Grails can give you a working application in days.


    [Servlet tutorial] [Servlet 3.0 Cook Book]
    Sandeep Awasthi
    Ranch Hand

    Joined: Oct 23, 2003
    Posts: 597
    Doing own research from scratch will take lot of time. If I have to choose, I will use presentations/blogs like this as a baseline data to shortlist few frameworks on which I can do research. Anyway this data and graphs are changing every year and there is no best. Finally its everyone's choice.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Web Framework