JSF and Spring performance vs poor JSP performance

前端 未结 5 1784
日久生厌
日久生厌 2021-02-10 13:57

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 jQuer

相关标签:
5条回答
  • 2021-02-10 14:27

    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.

    0 讨论(0)
  • 2021-02-10 14:36

    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.

    0 讨论(0)
  • 2021-02-10 14:37

    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.
    0 讨论(0)
  • 2021-02-10 14:38

    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.

    0 讨论(0)
  • 2021-02-10 14:40

    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.
    0 讨论(0)
提交回复
热议问题