149

we are in the planning stage of migrating a large website which is built on a custom developed mvc framework to a java based web framework which provides built-in support for ajax, rich media content, mashup, templates based layout, validation, maximum html/java code separation. Grails looked like a good choice, however, we do not want to use a scripting language. We want to continue using java. Template based layout is a primary concern as we intend to use this web application with multiple web sites with similar functionality but radically different look and feel.

Is portal based solution a good fit to this problem?

Any insights on using "Spring Roo" or "Play" will be very helpful.

I did find similar posts like this, but it is more than a year old. Things have surely changed in the mean time!

EDIT 1: Thanks for the great answers! This site is turning to be the best single source for in-the-trenches programmer info. However, I was expecting more info on using a portal-cms duo. Jahia looks goods. Anything similar?

Community
  • 1
  • 1
cosmos
  • 2,396
  • 4
  • 22
  • 25
  • 1
    "we do not want to use a scripting language", it's a shame, why if I can ask? if you like the Play framework you should try JRuby with Rails. It's not plain Java, but it's super easy to call Java classes from JRuby. – Luke Jan 18 '10 at 08:49
  • 2
    Grails (i.e. Groovy) plays very well with java, there's no need to be afraid. – Erich Kitzmueller Jan 18 '10 at 09:18
  • But performance is important: http://stronglytypedblog.blogspot.com/2009/07/java-vs-scala-vs-groovy-performance.html – Amir Moghimi Jan 18 '10 at 09:46
  • Oh come on, performance are relative... http://www.eishay.com/2009/07/microbenchmarking-scala-vs-java.html – Luke Jan 18 '10 at 12:47
  • I am a great fan of Groovy and Grails as well. However, existing standards and guidelines prevents us from deviating from java. It's a pity! – cosmos Jan 19 '10 at 02:18
  • 4
    @hbagchi: Just curious; 4 months later, which framework did you go with? Happy with it? – Jonik May 18 '10 at 05:41
  • 1
    isn't this a 'community wiki' question? – mickthompson Jul 03 '10 at 11:20
  • 11
    "but it is more than a year old. Things have surely changed in the mean time!"... Oh yes, God forbid that you should use technology that is more than 12 months old! The Silver Bullet has surely been invented in the meantime... :-) – ObiWanKenobi Sep 03 '10 at 07:21

17 Answers17

147

Is portal based solution a good fit to this problem?

Personally, I would stay away from big fat Portal solutions (they are often productivity killers). I've heard good things about Gatein though but I don't have any real experience with it.

Any insights on using "Spring Roo" or "Play" will be very helpful.

About Spring Roo, I've read previous answers like Spring roo Vs (Wicket and Spring) and other things over the Internet but I'm still not convinced (maybe I don't get it), I'm not sure of its maturity, and, more important, I'm really wondering what SpringSource is doing with Grails and Roo (no, Grails vs Roo - why SpringSource is pushing two very similar technologies? doesn't convince me that they will both survive).

I can't say much about Play. I've seen the demo like everybody but I would like to read real life feedback. Until then, I'll wait.

I did find similar posts (...). Things have surely changed in the mean time!

Yes and no :) But let's enter the presentation frameworks hell: there is no single answer to your question (like one year ago), there are dozen of frameworks around there and no clear winner. Just to cite a few:

  • JSF: Lots of skeptics about this component based framework, including me so I'm not the best one to talk about it but...
  • JSF 2 (+ CDI/Weld): JSF skeptics are encouraged (by Gavin King) to "take a second look". Indeed, I think that JSF 2 is a big improvement, especially with CDI, but... it is still pretty new (understand, it lacks of feeback). If you want to embrace Java EE 6, check it out though.
  • Wicket: Another component based framework that is getting more an more attention. I hear mostly good things about it: simpler than JSF, nice design, high testability, HTML designer friendly, etc. You may like it.
  • Tapestry: Just don't (see Why did you stop using Tapestry?)
  • Struts 2, Spring MVC, Stripes: Action based frameworks. All decent and will cover your needs (personally, I like Stripes and its convention over configuration approach, see Stripes vs. Struts2 to get an idea of it).
  • GWT, Flex, Grails: These aren't maybe not what you're looking for. I can't really talk about (recent versions) of Flex and GWT but I know that Grails does have some fans.

Actually, I'd suggest to take a look at Matt Raible's presentations, he really did a great job at comparing web frameworks, showing their strengths and weakness, gathering facts and numbers, showing trends... I recommend:

Really, have a look at these presentations, they will help you to find an appropriate framework (there is no unique answer but you can restrict the choice by elimination) and might change your point of view.

Community
  • 1
  • 1
Pascal Thivent
  • 535,937
  • 127
  • 1,027
  • 1,106
  • A good job, I have withdrawn :). +1 – Adeel Ansari Jan 18 '10 at 08:29
  • Matt's recent shoot out of java web f/ws was terrible. If i recall struts had practically the same score of much much richer more powerful f/ws. There is no way anyone could consider something as plain jane as struts worthy of a score that is only a few points behind GWT or Wicket. – mP. May 27 '11 at 08:53
  • 3
    Yes, I realize quite a few people didn't like my "matrix" or my logic for its ratings. In the end, what I was hoping to do with this matrix was to simply highlight a technique for choosing a web framework. You can read about logic behind my ratings in the following blog post: http://raibledesigns.com/rd/entry/how_i_calculated_ratings_for – Matt Raible Jun 29 '11 at 17:20
  • Matt Raible's presentation about comparing JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket is indeed quite old... – Abbas Gadhia Jul 09 '12 at 15:45
  • May be you would like to check the new Tapestry 5. It's way different and more fun now :) – Muhammad Gelbana Sep 18 '13 at 12:49
  • @MuhammadGelbana me too like and love Tapestry 5 !!!! – iberck Jan 19 '15 at 03:46
  • 1
    @iberck, I've been experimenting with AngularJS recently. Honestly, I believe it will shadow most if not ALL current web frameworks without exaggeration. Its simply a JS framework for the client side then you can retrieve your data easily and "efficiently" from the server using REST. Try it out, it will rock your world: https://angularjs.org/ – Muhammad Gelbana Jan 20 '15 at 11:06
41

I've been using Spring 3 and Jquery for a while but heard about Play and gave it a shot. I really like it, Play is a great fit between something like PHP and the heavy duty Java frameworks like Spring.

The things I like most about play are:

  • Very easy to get a play application off the ground, you have to go pretty far with coding and configuration to get a simple crud application on the screen with Spring (though Spring 3 has made it a lot easier).
  • Spring Security is awesome but it comes at the cost of complexity. Play's security module is very very simple and covers the needs of probably 90% of applications out there.
  • You can make a code change and hit refresh in the browser to see the change like with PHP instead of having to do the whole redeploy thing with Servlet based frameworks.
  • Error messages are displayed nicely and not so cryptic most of the time. Play still needs to work on their error handling
  • There's a plugin mechanism for Play that's pretty simple.
  • Object persistence is done very nicely in that an in memory database and JPA comes with the framework so there's no configuration of external object persistence tools. Going from the in memory database to an actual RDBMS is a one line change in the config file.
  • The MVC setup is done very well. The Model class you extend to create your domain objects integrates with the JPA entity manager. They're not just POJO's.
  • Mapping URL's to controllers is simple and flexible and all in one "routes" file.
  • Whenever you create a project Play handles all the jar dependencies and Play has a utility to eclipse-ify (or whatever IDE you like) the project so that it imports directly into your favorite IDE.

Things I don't like about Play

  • The documentation isn't all the way there yet, lots of undocumented features still exist.
  • The framework is the server so you have to dedicate a port to each application. I think someone is working on a virtual host plugin but I haven't seen it in action yet.
  • It's young, the project is awesome and technology is awesome but it really needs some more developers. I would love to dedicate some time to it, we'll see.
chad
  • 2,442
  • 1
  • 19
  • 6
17

Top choice for me is Wicket. Clear separation of markup and java code. Very easy to write and use components. Simple to use Ajax, testability. You can debug right into your pages / components and don't get cryptic error messages from your JSF implementation ;)

There is also a good comparison wicket <--> JSF in terms of performance

bert
  • 7,170
  • 3
  • 27
  • 47
  • 4
    +1 Not to mention pure OOP orientation with inheritance, polymorphism and composition. Also, XML-config files free! – Xavi López Oct 18 '11 at 13:31
  • 3
    Interessting that people downvote here because they do not like the framework suggested. Not just my Wicket answer, nearly all have some down votes.. – bert Nov 25 '11 at 13:17
13

The top three choices for me are (alphabetically):

They:

  • have good ajax support
  • allow you making actual web-sites, not applications (like GWT)
  • stable, well-documented, widely used
  • MVC
  • pure Java
  • easy integration with Spring as middleware
Bozho
  • 554,002
  • 136
  • 1,025
  • 1,121
  • 17
    I have no idea how one can claim that JSF can be used to "make actual web-sites". Any framework that forces the use of POST loses immediately in this regard. – Stefan Tilkov May 18 '10 at 11:31
  • 3
    I have developed "actual websites" with JSF, and I've used such, without any problems. Furthermore, using POST is forced only when you are posting something. You are always free to use simple GET navigation. Theoretically, it is wrong to use GET if you are modifying a resource, isn't it? – Bozho May 18 '10 at 11:47
  • plus, you'd have to downvote Pascal, as well for suggesting JSF ;) – Bozho May 18 '10 at 11:48
  • haha, hilarious.. 2 downvotes because "you can't make real sites with JSF". – Bozho May 18 '10 at 12:56
  • 3
    No offense but this sounds like a list of 'stuff' you'd have seen years ago, so I'm just surprised to see it. In my experience, most have since moved on from those missteps. I suppose if you're already an expert in these they'd be excellent choices, but I'd be concerned for O&M programmers who have to take over after the experts leave the project. Nobody's really learning this stuff any more IMO. – Manius Aug 07 '10 at 18:47
  • a bit of later comment but - the projects that I learnt these technologies in were successful. And no one else on the team knew them. Perhaps I'm a superfast learner, but it did work fine. – Bozho May 11 '11 at 06:53
  • 1
    This line of comments is a little hilarious indeed. JSF can of course perfectly well be used for web sites, and it has first class support for both GET and POST. Use what is most appropriate for the situation at hand. Indeed as Bozho indicates, if it modifies a resource don't use GET, otherwise feel free to do so. – Arjan Tijms Oct 09 '11 at 20:36
11

Play is closely similar to ROR, a ROR version in java

Gerard Banasig
  • 1,595
  • 12
  • 19
10

In contrast to other answers, I'd like to highlight the disadvantages (IMHO) of popular web frameworks:

JSF2 - Released and already aged. Still only a few news/articles/blog posts/experiences out. I am skeptical. Still waiting for the next major release of Richfaces/Icefaces which fully supports jsf 2 - currently only alpha builds can be downloaded.

Struts 2 - Seems to be only a good thing if you're still relying on struts and want to refactor most of your code. Otherwise: Don't.

GWT - I do not like the single-page and the java->javascript approach. I am not sure if one session - multiple views/windows can be easily achieved. For me, this framework should be used for massive-users single-window rich internet applications.

Wicket - Nice approach, but a little bit verbose and too less documentation available (except the good wicket in action book, but this covers only 1.3). Also, for me it lacks of big projects which are built on top on it. And I currently cannot see where the road of wicket is traveling or if it has already been driven to a dead end.

Spring MVC - Did not tried this yet, but you have to include many jars (spring mess) in your classpath to work with this framework properly. And it relies on JSP (in most projects), which I consider already dead. And you get only a pure MVC framework - all other things (ajax and others) have to be implemented/integrated.

Stripes - A small and nice designed MVC framework, but too less documentation, too less commits/committers, too few releases, too less industry support, too less mailing list activity.

I am also curious if I missed a major framework out there (I left Tapestry out intentionally) which might be an option for you (and also for me, too).

MRalwasser
  • 14,580
  • 14
  • 95
  • 134
  • I have found the best way to handle this is similar to what the Python web frameworks have done: Pick and Choose from the best. For example: Spring + JAX-RS – Adam Gent Nov 30 '10 at 19:26
  • Your comments about GWT are wrong. Its quite easy to have many separate pages rather than one big thing. Insert a link to another page to start another "action" and alls well. – mP. May 27 '11 at 08:55
  • I am also talking about multiple windows (or tabs). Is it really possible to use more than one window using the same session simultaneously? – MRalwasser May 27 '11 at 09:02
  • 1
    +1 Why did this post got 2 negative voices? Sceptic opinions like these are equally important (if not more) than positive ones! And these seem to me like constructive ones. – Piotr Sobczyk May 09 '12 at 13:48
8

I have had great success with JAX-RS. It is the only Java Web Framework that has some sort of JSR spec and multiple implementations other than the servlet and portlet spec (although this can be a bad thing).

One thing that is bad and good about Java is that you can pick and match frameworks (python also has this feature/problem). Its nice because you don't have to put all your eggs in one basket.

Here is a general Java Web Application Stack Recipe:

Javascript/Flash + Request/Response handling + Dependency Injection + Persistence

Javascript: JQuery, Prototype, Dojo

Request/Response: Spring MVC, Stripes, and my favorite JAX-RS (Jersey, Apache CXF)

Dependency Injection: Spring, Guice

Persistence: JPA (Hibernate, Google App storage), Hibernate, JDO and more.

I also have had great success in using AspectJ to make Java "suck less". By using Spring's @Configurable and AspectJ's ITD mixins you can get Rails like Domain objects (this is infact what Roo does but you don't need Roo to do this).

Adam Gent
  • 44,449
  • 20
  • 142
  • 191
  • 4
    I agree. It takes more time to set up your own stack, but then you get exactly what you want. I'm currently using jQuery, Jersey, Spring and JPA2. JAX-RS is great because you have complete control over what your response is. – Brian DiCasa Jan 18 '11 at 20:55
6

I've found stripes to be really effective and surprisingly lightweight....it aims to be more lightweight than struts. I've heard from friends that are fulltime web developers that JSF is not worth bothering with, although I have no firsthand experience, and can't back that up with examples (!).

James B
  • 3,562
  • 1
  • 23
  • 32
5

Have a look to RESThub, that follow the same principles that Play! but implemented by reusing some enterprise grade frameworks/tools like Maven 3/Spring 3/Jersey/jQuery.

RESThub is very disruptive comparing to other frameworks since it is a full stack toolkit, but without any serverside MVC or servlet based framworks. Instead, it use a jQuery UI based GUI that use JAX-RS (REST) webservices and a Javascript templating system based on embeddedJs.

Servers are stateless, and we use HTML5 sessionStorage to keep session on client side. This approach is design for RIA and scalability.

Some demo applications are provided (even if under construction).

3

JSF is a nice framewrok, but JSF 1.2 lacked vision for years to come from its release. JSF 2.0 looks promising and has many new things added fro m JSF 1.2 like ajax support, facelets, Annotation support and default conventions (less XML),easy component building than 1.2.

It integrates well with Spring also, if you are concerned for DI support.

user252942
  • 59
  • 1
2

I would second the Spring recommendation. I'm not a huge fan GWT, I don't think the Java -> Javascript crosscompiler is quite there yet. I am working on an AJAX app that uses spring on the server and jQuery on the client. Although there is technically not "out-of-the-box" support for jQuery, implementing a spring-MVC AjaxView is dead simple and took about 25 lines of code.

D.C.
  • 14,811
  • 18
  • 64
  • 102
2

Maybe a little bit late to the show, but I have to mention Vaadin. Programming is done in Java exclusively, with a component-based approach. Client-Server communication is more about user interaction than data transport, all business logic resides on server.

KoW
  • 794
  • 4
  • 12
1

Ext GWT + Spring

Mihir Mathuria
  • 6,179
  • 1
  • 20
  • 15
1

I think what you are looking for is something close to Jahia. It supports GWT, Mashups, Media Content etc.

http://www.jahia.org/cms/lang/en/home/Jahiapedia/Jahia_Templates http://www.jahia.net/downloads/jahia/jahia6.0.0/readme/index.html

Syed M Shaaf
  • 204
  • 1
  • 3
  • Looks good! Is this open source / free for enterprise? Is this widely used? – cosmos Jan 19 '10 at 05:08
  • It has a Community version with all the basic stuff and and enterprise version with some additions etc. Check this place http://www.jahia.com/jahia/Jahia – Syed M Shaaf Jan 20 '10 at 12:27
1

BACKBASE PORTAL SOFTWARE

Couple of years back have used portal software "Backbase" this was not very matured then. But was good and easy for development.

YoK
  • 13,731
  • 4
  • 46
  • 66
1

Take a look to ItsNat

ItsNat is basically a Java W3C browser in server, amazingly simple (DHTML in server), promoting AJAX intensive Single Page Interface applications

jmarranz
  • 6,381
  • 2
  • 18
  • 10
  • Nothing like a fully documented feature showcase of a framework: http://www.innowhere.com/itsnat/feashow_servlet?itsnat_doc_name=feashow.main – Ravindranath Akila May 21 '13 at 06:48
0

Something that deserves more than just a bullet are player based RIA frameworks. Ex. Adobe Flex + Java (Of course this can hinge somewhat on whether your "site" is really a "site" or more like an "application", you wouldn't do a blog site in Flex.)

ajax,

In the AJAX-as-a-buzzword sense, Flex typically uses AMF (a binary protocol that's more efficient than protocols used by AJAX apps), although you can also do strictly AJAX stuff with Flex too. So Flex supports AJAX, but also supports "better than AJAX".

rich media content, mashup,

Being that Flex runs on the Flash 'virtual machine' platform, I think little needs to be added.

templates based layout,

Not sure what this is getting at exactly, but it sounds like Flex mxml.

validation,

Supported of course, although you may decide to do some custom stuff if you want to get fancy. (Not that you have to.) The nice thing is that you can get as sophisticated as you want--or not.

maximum html/java code separation

You can't get more separated by using a 'virtual machine' development approach like Flex/Silverlight/JavaFX. This doesn't just enable you to keep your presentation code separated from your server-side logic and data access layer--it ensures that they're separated. 'Virtualizing' your development environment gets you cross-browser compatibility, a consistent target platform, no worries about new browsers or new browser releases breaking your application, top of the line java-like debugging capabilities, and a more professional/impressive looking end product.

Manius
  • 3,213
  • 3
  • 32
  • 40