views:

792

answers:

12

I'm creating an web application for company intranet, because other parts of this system are written in Java, so for integration purposes Java was chosen as a web frontend.

There are the requirements:
- it has to be simple to learn in short period of time
- it has to support MVC pattern
- no extended xml configuration
- application will consist of many form that user will fill, and some js to help with it
- good IDE plugins that will help with development

I was thinking of Wicket/Spring MVC/Stripes

What are your recommendations regarding those requirements? What other frameworks, that are probably better for my application should I look at?

Also: can you comment those three frameworks on how do they meet my requirements?

+5  A: 

Check out Grails; it's the best of Rails and Java. Excellent MVC (including ORM), DRY, and coding-by-convention (no XML config!), very similar to Rails but even better in some ways (IMHO), plus all the stability of the Java platform and access to all of its excellent libraries.

It uses the JVM-based Groovy scripting language but the learning curve shouldn't be too bad for a Java developer; you can also use straight Java code if you need.

maerics
There's also extensive IDE support through Spring IDE(http://www.springsource.org/springide/release-20); In fact Grails is actually "just" a Spring MVC application extension if you really want to be pedantic.
Esko
Caveat! I realy like grails/groovy BUT debugging can be a pig the normal java debugger is almost useless as it steps through all the internal groovy classes this is escspecially problematic with closures as what looks like a simple ".each()" loop in your program may involve ten or twelve groovy classes.
James Anderson
@James Anderson: true, and those stack traces can be dizzying...
maerics
Debugging is not only a pain, but also more often needed bedause of some strange Grails errors/behaviours.
deamon
+2  A: 

Have a look at the play framework and walk through the tutorial. I'm pretty sure that I will come back to this framework, when I have to/want to write a web application.

Andreas_D
+2  A: 

Maybe Spring Roo? It works very well when you app mostly about forms and reports.

As alternative i can recommend you Grails, but there can be some complication when integrating it with your current java code.

splix
+8  A: 

Based on this requirement:

it has to be simple to learn in short period of time

I would not recommend Spring-type framework as you'll have to learn a lot about their modules.

Take a look at Play java framework. The structure is very similar to Ruby On Rails but written using Java. Scala is also supported. One of the best benefits is the auto-compilation. On your local dev, you can update code, refresh the browser and see your changes instantly.

It's also unique from other java frameworks by taking a stateless model for easier scalability.

tommy chheng
Depending on the IDE and the local servlet container setup it is possible to see code changes immediately with (almost) any framework.
deamon
I'm impressed by how close to Rails/Grail they have managed to get in The Play Framework, despite being implemented in Java. One thing to be aware of though is the deployment model, it's not trivial (or recommended) to deploy to a 'regular' servlet container or app server. So that's one thing to keep in mind if you have a specific runtime requirement.
rlovtang
+1  A: 

I've very successfully built a small internal company app. in Clojure using the Compojure framework. It's a very simple and elegant framework that should meet your needs if you're willing to learn Clojure.

Example code from the Compojure Wiki that implements a simple calculator:

(ns example 
  (:use compojure)) 

(defn html-doc 
  [title & body] 
  (html 
    (doctype :html4) 
    [:html 
      [:head 
        [:title title]] 
      [:body 
       [:div 
    [:h2 
     ;; Pass a map as the first argument to be set as attributes of the element
     [:a {:href "/"} "Home"]]]
        body]])) 


(def sum-form 
  (html-doc "Sum" 
    (form-to [:post "/"] 
      (text-field {:size 3} :x) 
      "+" 
      (text-field {:size 3} :y) 
      (submit-button "=")))) 

(defn result 
  [x y] 
  (let [x (Integer/parseInt x) 
        y (Integer/parseInt y)] 
    (html-doc "Result" 
      x " + " y " = " (+ x y)))) 

(defroutes webservice
  (GET "/" 
    sum-form) 
  (POST "/" 
    (result (params :x) (params :y)))) 

(run-server {:port 8080} 
  "/*" (servlet webservice))
mikera
p.s. note the Integer/parseInts.... nice example of the painless Java interoperability as these are direct calls to the Java functions.
mikera
:-Q Sorry, could not resist.
Ondra Žižka
+2  A: 

I can recommend Wicket. It is quite hard to learn, but then you'll love it. It's the first web framework I actually like to work with.

Note that Wicket is not good for quick and dirty solutions. Use it only if you like clean and ellegant solutions and you are ready to invest +10% of time for great code reusability, readability.

I mean, for example, there's no quick <% if( ... ){ %> ... <% }%> in Wicket.

Well... read some nice tutorial and you'll get my point. Here's my humble list of resources: http://ondra.zizka.cz/stranky/programovani/java/web/wicket/index.texy

Ondra Žižka
Yeah, but requirement 1 was "it has to be simple to learn", so....
skaffman
+2  A: 

I have built a number of web applications of varying size with Wicket.

Wicket takes a very different approach to things compared to most other web frameworks. If you have experience with building Java apps with Swing, building Wicket components will probably seem familiar to you. The main thing that drives my choice between Wicket and some other framework (Struts 2 tends to be the other one) is the "statefullness" of the web app. Wicket is great if the pages are stateful. If not, the value it adds, IMO, decreases significantly. One of my favorite parts in Wicket is the way it separates code from the markup, and how an .html file can extend another one. I have yet to really look into the best practices of making a web app built with Wicket very "ajaxy" - so far my experiences around integrating with JavaScript frameworks have been pretty clunky.

Whether or not Wicket is simple to learn in a short period of time is difficult to say without knowing more about your background. I also haven't used any IDE plugins, nor have I felt the need for such. The other items on your list - check!

Lauri Lehtinen
A: 

jsp and servlet is the basic technology, if you want use Spring MVC or struts, you have to master servlet technology. you can use jsp and servlet only to make MVC pattern, jsp is View, servlet is Controller, other business logic is Model. it has to be simple to learn in short period of time, and it's helpful to use other MVC framework.

Java Man
+2  A: 

I would use Wicket, which comes without XML config. It is clean and relatively easy to learn. Don't use Spring MVC if you aren't a big fan of XML. Spring can be configured with Java - in theory. But in practise you'll end up to configure it with verbose XML. Another shortcoming is Spring MVC is more flexible than it has to be, what means you have to learn more than you really need.

deamon
+2  A: 

Use Play! Framework :). It's a real RAD framework and easy to learn.

Coder
http://www.playframework.org/
Thorbjørn Ravn Andersen
+1  A: 

Try HybridJava.

  • it has to be simple to learn in short period of time
    • simple as nothing else. about 15 pages of documentation.
  • it has to support MVC pattern
    • it supports pattern of MVC components, not only pages. Nothing like that around.
  • no extended xml configuration
    • it has zero configuration. No xml, no annotations, no properties.
  • application will consist of many form that user will fill, and some js
    • it gives a code reuse mechanism by far superior to that of JSP
  • good IDE plugins that will help with development
    • IDE plugins are not ready yet, But probably you will not even need them.
Alex
+1  A: 

Play framework can rule the java world. It combines the best of django/rails/php with java/scala. Simplicty is the key, it's so easy and so powerful, type safe, high performance, stateless, has perfect module system, mvc architecture with a good tempalte system and internationalization, immediate support and bug-fixes, no need to use application servers, tracks and dynamically compiles code changes in the background, state of art unit test and jpa integration, has crud, db versioning, spring, guice, mongodb and tens of modules, comes with caching, logging,... and son on...

sirmak