JSF: is it more than a JSP tag library?

J

Josef Templ

Hi Everybody!

Reading through tons of online docs about JSF (Java Server Faces)
I got the feeling that essentially:

"JSF is a pair of tag libraries for JSP".

Is this an over simplification or is it a precise technical
characterization of JSF?

I have not found a statement a simple as the above
one in any of the official docs.
Quite to the contrary, from the docs it is very hard to conclude what
JSF is. Of course, a tag library can be a complex thing
by itself and it can introduce a lot of concepts (event handlers,
config files etc.), but it would still be a tag library.

Follow up question: is a conforming JSP 2.0 implementation
plus the JSF tag libraries all what's needed for using JSF?

Any feed back from people who really know what JSF is
would be deeply appreciated.

- Josef Templ
 
B

Bryce

Hi Everybody!

Reading through tons of online docs about JSF (Java Server Faces)
I got the feeling that essentially:

"JSF is a pair of tag libraries for JSP".

According to

JSF is
* A set of APIs for representing UI components and managing their
state, handling events and input validation, defining page navigation,
and supporting internationalization and accessibility.
* A JavaServer Pages (JSP) custom tag library for expressing a
JavaServer Faces interface within a JSP page.

That last part is what you state above.
Is this an over simplification or is it a precise technical
characterization of JSF?

I have not found a statement a simple as the above
one in any of the official docs.
Quite to the contrary, from the docs it is very hard to conclude what
JSF is. Of course, a tag library can be a complex thing
by itself and it can introduce a lot of concepts (event handlers,
config files etc.), but it would still be a tag library.

Follow up question: is a conforming JSP 2.0 implementation
plus the JSF tag libraries all what's needed for using JSF?

No. You need the JSF libraries.
 
J

Josef Templ

Follow up question: is a conforming JSP 2.0 implementation
No. You need the JSF libraries.

So, this sounds like it will be trivial to support JSF in any
conforming Servlet container plus JSP compiler by simply
making available the JSF tag libs and some additional jar files.

To summarize, we end up with a layering of technologies as follows:
- At the bottom, there are (http) servlets.
- A JSP is HTML + embedded Java that is compiled into a servlet.
- A JSF-page is a JSP-page which uses the JSF tag libraries.
- The tag libraries support the JSF GUI component model that allows
to separate presentation from business logic such there is no hard-coded
use of HTML in the business logic.

- Josef Templ
 
B

Bryce

So, this sounds like it will be trivial to support JSF in any
conforming Servlet container plus JSP compiler by simply
making available the JSF tag libs and some additional jar files.

Pretty much.
To summarize, we end up with a layering of technologies as follows:
- At the bottom, there are (http) servlets.
- A JSP is HTML + embedded Java that is compiled into a servlet.
- A JSF-page is a JSP-page which uses the JSF tag libraries.
- The tag libraries support the JSF GUI component model that allows
to separate presentation from business logic such there is no hard-coded
use of HTML in the business logic.

Although I'd hesitate to say JSF is a layer above JSP. I think it
would be more correct to say it can use JSP to genenerate web GUIs.
 
A

Adam P. Jenkins

Josef said:
So, this sounds like it will be trivial to support JSF in any
conforming Servlet container plus JSP compiler by simply
making available the JSF tag libs and some additional jar files.

To summarize, we end up with a layering of technologies as follows:
- At the bottom, there are (http) servlets.
- A JSP is HTML + embedded Java that is compiled into a servlet.
- A JSF-page is a JSP-page which uses the JSF tag libraries.
- The tag libraries support the JSF GUI component model that allows
to separate presentation from business logic such there is no hard-coded
use of HTML in the business logic.

I would not characterize JSF as just being a layer on top of JSP. JSF
is a web application framework that provides programming model more like
the stateful event-handling model of traditional GUI apps than the
stateless request/response model of traditional webapps. It provides a
hierarchy of GUI controls and a framework for decoupling event
processing and rendering, and pluggable presentation layers. The JSF
spec requires that any JSF implementation provide a JSP presentation
layer implementation, and in practice that will likely be the most
commonly used presentation layer. However the JSP presentation layer is
only a relatively small part of JSF, and can easily be replaced by just
providing your own implementation of javax.faces.application.ViewHandler
which uses the template language of your choice, or no template
language. So I think you'd be missing the point of JSF if you just
think of it as a glorified JSP tag library, as the JSP portion of JSF is
only a small and replaceable part.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top