• Post Reply Bookmark Topic Watch Topic
  • New Topic

To authors: markup agnostic  RSS feed

 
leonard eli
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
how can a JSP implementation be "markup agnostic" ?

Does a request parser exist (like a servlet filter)?

May I make a response in wml or in a custom-defined xml format?

Thanks,
 
Fintan Conway
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by leonard eli:
Hi all,
how can a JSP implementation be "markup agnostic" ?

Does a request parser exist (like a servlet filter)?

May I make a response in wml or in a custom-defined xml format?

Thanks,


Hi Eli,

The point with JSF is that the rendering technology is fully pluggable. The default render kit that comes with some JSF implementations is JSP. However some technologies like facelets use xhtml.

You can define your own render kit which will be used to render the mark up in whatever format you define. The advantage of this is that the page is written in exactly the same way, and depending on which render kit you plug in it will display in JSP, xhtml, your custom xml format, etc.

HTH,

Fintan
 
leonard eli
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fintan,
thanks for your answer.

May you please explain me, how does it work (Behind The Scenes)?

Does jsf implementation use something like a servlet filter in order to parse the request and delegate the response to the appropriate kit?
[ September 12, 2006: Message edited by: leonard eli ]
 
Fintan Conway
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by leonard eli:
Hi Fintan,
thanks for your answer.

May you please explain me, how does it work (Behind The Scenes)?

Does jsf implementation use something like a servlet filter in order to parse the request and delegate the response to the appropriate kit?

[ September 12, 2006: Message edited by: leonard eli ]


Hi Leonard,

The heart of the JSF implementation is the JSF lifecycle. Normally when you submit a page the application runs throught the 6 phases of this lifecycle - reading values from the submitted page, converting them from strings to java types, performing any validations required, responding to any events, determine the next page to display and finally displaying the next page.

The last phase is called the Render Response phase. This is where a new page is built from its components. All these components are known on the server (saved as a component tree). In the configuration file you can tell JSF which Renderer you are using. Each renderer knows how to 'draw' each component. At the Render Response phase JSF looks up the java class associated with the renderer and passes the component tree to this class. The class then renders each component in the component tree in the correct order.

The lifecycle phases are not really like Servlet filters. They take the component tree as input and generate the relevant markup (html, wml, xhtml) as output.

HTH,

Fintan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!