JSF and Spring performance vs poor JSP performance

2020-06-06 01:37发布

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 currently 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.

5条回答
够拽才男人
2楼-- · 2020-06-06 01:39

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.

查看更多
狗以群分
3楼-- · 2020-06-06 01:42

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.

查看更多
干净又极端
4楼-- · 2020-06-06 01:55

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.
查看更多
The star\"
5楼-- · 2020-06-06 01:57

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.

查看更多
劫难
6楼-- · 2020-06-06 02:03

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.
查看更多
登录 后发表回答