dev@jsftemplating.java.net

Re: Question on JSFTemplating

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Sun, 12 Aug 2007 14:00:44 -0700


Nahid Parsa wrote:
Hi,
It's me. Still I'm curious about JSFTemplating. I'm looking for a way to use JSF in my own servlet to make UI. It is about to make a JSF stream and feed this stram to the jsf parser. I have no jsf file.
If you provide your own LayoutDefinitionManager implementation for JSFTemplating, you can take your stream of data and build a JSF UIComponent tree that will display JSF components.  This is how JSFTemplating is able to read the Facelets syntax and its other 2 syntaxes.  While all of these are file-based, they don't have to be.

However, JSF expects to use its own Servlet, so you'll either have to let JSF handle the request, then use your own LayoutDefinitionManager to invoke your XSLT.  Or, you'll have to make your servlet open a URL to a JSF url and have your data available for it to find.
Some xsl files are used by my servlet to make a html view. Now, I want to change the xsl files to make jsf codes (instead of html) to use the power of jsf. It needs one more jsf parse step. I tried to make servlet chain or filter chain ( i use tomcat 5 or higher and they do not support servlet chaining directly). After all I came to this point: each filter in a filter chain can not use the previous one's output and it can only make some changes in the request OR add something to previous ones's output. Its all the story.
Now, would you tell me, First is it possible? and Then, How to do so.
You might be able to make a servlet filter (or several of them) work.  However, it is not an easy way to integrate with JSF as it expects to operate on the QUERY_STRING parameters and write directly to the output stream.  I think the filter approach would be a lot of work.  Instead consider writing your own LayoutDefinitionManager which will be able to process any data you want to generate from XSLT.  There are 3 implementations currently available in the JSFTemplating source code for you to look at, although depending on what you want to do, yours may look very different those.

You can talk with me and other developers on the JSFTemplating IRC channel at: irc.freenode.net #jsftemplating

Good luck!

Ken
 
Regards.
Nahid.

----- Original Message ----
From: Ken Paulsen <Ken.Paulsen@Sun.COM>
To: Nahid Parsa <nhdprs@yahoo.com>
Sent: Monday, August 6, 2007 7:34:24 PM
Subject: Re: Question on JSFTemplating


Hi Nahid,

I am on vacation until Wednesday and have limited access to my email.  JSFT could process and XSLT files similar to what your servlet is doing... however, JavaServer Faces does not allow you to have your own Servlet class, so it is not straight forward to use JSF components outside JSF (with another Servlet).  However, it is not impossible... I'd like to learn more about what you're trying to do to see if JSFT is useful for you.  Perhaps we can talk more on Wednesday.

Good luck!

Ken

Nahid Parsa wrote:

Dear Sir, Thanks for your attention. You encoraged me to ask more questions.
I have a Servlet which uses XSLT files to make UI. The XSLTs contain html codes. Now, I want to use JSF tags in the XSLT files and then pass this to JSF Parser. I googled and finally I found JSFTemplateing. I want know does JSFTemplating do what I want? Can I use JSFTemplating as a part of servlet chains which parses my servlet response (a stream of jsf) to make the proper output to be shown by browser.
 
Thanks for your help.
Regards.
Nahid Parsa.
----- Original Message ----
From: "Ken.Paulsen@Sun.COM" <Ken.Paulsen@Sun.COM>
Sent: Wednesday, August 1, 2007 9:27:10 PM
Subject: Comment: JSFTemplating + DynamicFaces = Easy Ajax

Ken Paulsen wrote:

Hi, https://jsftemplating.dev.java.net should be accessible. If it wasn't collab.net (hosting company for java.net) was probably in the middle of breaking something -- they do that from time to time. :(

If you have any more problems, please let me know. You can get help for JSFTemplating via the email lists on the java.net site. You can also join the #jsftemplating IRC channel at irc.freenode.net.

Good luck!



Respond to this comment at:
http://blogs.sun.com/paulsen/entry/jsftemplating_dynamicfaces_easy_ajax#comments



Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool.



Be a better Heartthrob. Get better relationship answers from someone who knows.
Yahoo! Answers - Check it out.