Testing some FrameWorks and applications on Glassfish build 40+ part II

In this part I am going to test two other Open source frameworks on GlassFish. first of all I like to say that it is funny to test frameworks on GlassFish , at least until now , I faced no problem with deploying sample applications that come with frameworks distribution.
in this part I will test : OSCache from opensymphony and The famous Facelets .
but why I should test OSCache, and what is OSCache? let me tell you that it is a brilliant framework again from provider of WebWork and SiteMesh , it can cache what ever you like from a java object in middle layers to some part of your jsp/jsf? page in view layer. some of its features are as listed below:

  • Caching Dynamic Content : you can cache some part of a JSP pages between requests.
  • Caching Binary Content : cache heavy to generate contents like Charts that does not needs to be up-to-date
  • Error Tolerance : show cached content in case that a page encounter a problem and report the problem back to some administrator

I used OSCache for caching some parts of web pages and also to cache heavy to generate Charts for visitors of a web based system. In my case creating each chart needs several complex queries over a large Tables. On that time I used JFree Chart to handle chart creation and OSCache to cache The generated charts even for more than 24 Hours.
Now that I come to test each Frameworks that I used in past with GlassFish I decide to test OSCache to. So , I deployed the sample application that come with OSCache and it works.
To make it more likely I test the OSCache with JSF on GlassFish , it looks like that it works fine even with JSF but sure it needs more investigation to make sure that it works when we use JSF .
following image shows that I run the sample application that come with OSCache with an small change (using JSF core view to include all stuff showed in the page , using a backing bean and a binding for outputText value to show current TimeStamp).

Another framework that I test and I will talk about it in this entry is Facelets , but what is this framework and what can it do?in very brief Facelets bring some view related enhancement and features to JSF community .
To name some of features :

  1. Facelets make it possible to develop your entire web pages using your favorite page designer like Dreamweaver or Microsoft FrontPage. To achieve this feature it introduce a new attribute, jsfc ,that make it possible to change each HTML element to a JSF equal component. It is similar to Tapestry’s jwcid attribute. So you can use all binding and event handling stuff of JSF and availability and ease of use of HTML WYSIWYG.
  2. Facelets provide a template-ing features like Velocity’s for JSF . It allows you to test JSF views out of container.
  3. Some decoration features like what tile bring to struts community and SiteMesh ,generally, to all java based web application.

although I want to explain a bit more about feature number 1 , WYSIWYG HTML designers and Facelets. The designer should be able to produce XHTML , it means that the generated HTML file should comply with well-formed XML files syntax.For example all tags should be closed properly and no with brief model .
But Facelets is really a nice piece of works and a gift to JSF community. I Like too much to use Facelets in next jobs , but we should wait and see what customer want.
Now lets take a look and see what will happen when we try to deploy numberguess.war which come with Facelets Distribution.
sweet it just run , very good to see such such sweet deployment. I remember that first time which I have tried to deploy this numberguess.war which come from Facelets 1.0.11 on tomcat I faced some problem.When I looked inside web-inf/lib folder I find that here two implementation for JSF there , one was myfaces and the other was jsf-ri implementation. I removed the myfaces.jar and it runs.
this image shows what I have seen after I deployed numberguess.war into GlassFish.

Leave a Reply

Your email address will not be published. Required fields are marked *