views:

2878

answers:

6

I saw some JSF projects developed by my collegues and these projects seemed to me very slow. Does anybody have the same opinion?

I'm currenly using jsp+jstl and jQuery for "rich" client.

I wonder what advantages and disadvantages have modern frameworks (jsf, wicket, tapestry..) over old plain jsp.

It would be great if people who used all these technologies had answered.

It's also interesting for me which most exciting features made you to leave jsp and use "massive" framework (I mean, for example AOP in Spring or something else whatever you can notice).

Thanks for all comments.

A: 

Many advantages. I can enumerate JSF advantages which are those I've used in my last project.

  • Centralized place for the navigation (like in struts)
  • Components like a date-picker, auto-completion, paging, etc.
  • You have renders for the layout which facilitates a lot some layout logic.
  • Availability of tiles, like in struts.

JSP doesn't make a clear separation between business logic and layout.

Anyway, although all this advantages and if you are a Java programmer I would advice to take alook at Grails which is pretty much more comfortable.

Luixv
The name is just "Grails" now; They were asked by the Ruby on Rails guys to change it.
Michael Borgwardt
Nice to know. Thanks for the comment. You got a point up from me.
Luixv
Two alternatives to Grails would be: 1. Lift (http://liftweb.net/). It runs on the JVM, but you'd have to learn Scala (though that is a great language to learn :-)). 2. JRuby on Rails, that's Rails running on the JVM (http://wiki.jruby.org/wiki/JRuby_on_Rails). Again, though JRuby runs on the JVM you'd have to learn Ruby to work with it.
Javier
A: 

JSP is extremely primitive, you basically have no widgets and have to build everything yourself. JSF while an improvement is not the best web framework for java - there are plenty of others that enable you to achieve a much more impressive result - eg GWT.

mP
This might be biased, but GWT (http://code.google.com/webtoolkit/) is more of a web-FRONTEND-framework than a real web-framework to me.
Javier
I also see no use in JSP, especially its presence in Java EE. It should be just an optional library. But it seems that most people like to mix content and code (which is an anti-pattern).
ivan_ivanovich_ivanoff
@JavierIn the end its about the users end experience, both deliver to the browser.. the user doesnt care how it got there as long as it works and keeps them happy.
mP
+2  A: 

I totally like to use JSP 2.0 as templating technology -- that is I use Spring MVC to access my domain objects and prepare all data I need for a certain view and leave it to JSP to render it. JSP 2.0 because I like to use tag files for template composition which allows me to use simple JSP 2.0 where I would need other compositing frameworks else.

I intentionally avoid everything in JSP that basically is programming. No data acess, no SQL, no scriptlets, no methods, no nothing. just plain presentation of pre-existing, controller-provided data with maybe some simple cases and iteration of collections.

fforw
+6  A: 

I've used CGI, PHP, JSP, Struts, Spring MVC (1.2), Bea workshop, JSF, JBoss Seam, Spring MVC (2.5) and Wicket (in that order). I've noticed a jump in both productivity and quality for each new technology I've worked on. It just works better, It feels better. I prefer Wicket (with a twist of spring, quartz, etc.) over all of the others. I can honestly say I saw the light, and I don't want to go back to a darker -- or lighter ;) -- side.

There is a lot to say about Wicket.

  • Conversational support (or tab-enabling) comes by default, you do not worry about "open in a new tab" and "back" button problems ever again.
  • It is component-based, so you can re-use code ala swing.
  • Leverages a lot of the standard Java, like the type safety wonders.
  • Supports advanced security features like url encryption.
  • Clusterizable applications by default.
  • And, most important, it is fun to use.

There is a lot to improve for JSP and JSF.

  • The one thing that bothers me the most is the "EL" nonsense, for I believe it breaks the nice java type safety and strength.
  • Both need tooling support for high productivity.
  • You need another framework on top of both of them to really solve the problems (as seen with seam framework, which makes JSF usable).
  • The error handling is very tricky and the exceptions are not straitforward helpful.
  • It is difficult to make reusable components on both frameworks and doesn't support a proper model for separation of concerns.
  • ... and, most important, a long etc of minor pains, like this, or this.
Marcelo Morales
Yeah wicket is fine! You should also try Grails (with GORM as very powerful ORM Layer). Its similar to ruby on rails.
Martin K.
A: 

Benefits of Spring MVC:

  • The framework subtly encourages you to write better designed code: by using dependency injection, and splitting up your application design into domain (model) objects, controllers, service classes, DAOs, etc.
  • As a side effect of the first bullet point, your code ends up being extremely and easily unit-testable.
matt b
A: 

Slowness in Java webapps is often caused by programming with none or poor knowledge of HTTP specs, the raw JSP/Servlet and Java IO API's, the raw HTML/CSS/JS code. You see this often with ones who uses a visual editor and/or dumps everything in the session scope as if it's the holy grail. Those are often ones who (unfortunately) were thrown in a deep hole with the only words "build a webapp using MVC framework X and IDE Y" while one has totally no knowledge of all how it works "under the hood".

(sorry if this hurted someone, but that is what I've observed in years ;) ).

BalusC