Hi Tim,
Thanks for the response. I had a look Apache Commons EL framework but couldn't find any documentation on it. I will look again.
I will just give you a background on what I am trying to do:
I have been able to achieve a few things effectively with the approach that I talked about. When using AJAX, sometimes its required that you create a complex web page corresponding to an AJAX request. Currently the frameworks based on AJAX only provide a way to invoke a server-side
Java method and allow you to return Text/XML as the response. Thats it. But in any business application you need more than that. For example, the return HTML from the server represents a data table (alongwith a datascroller component) and the column header are supposed to allow you sorting. This is only possible if we make use of tiles/templating feature while composing these HTMLS. This i could achieve programmatically ( and I pretty sure I can externalize this templating feature into an XML file just the way we do it in Struts).
Even if I use tiling feature i still need some way to customize portions of the HTML or they will not be usable across different pages. One way is that I customize it programmatically, which is not good because the code now carrys the logic which could have been easily pushed to the HTML by using some kind of an expression language.
Working on a complex application made me realize that AJAX can't be used easily in generating complex web pages unless AJAX frameworks are extended to provide the same features as it is available to technologies like
JSP. JSP has JSTL, expression language, etc. I think somewhere (at post-processing) if AJAX frameworks can do the same things as JSP engine does to JSP page I think it will be pretty easy to create a complex web page. I am not sure how many people will agree with my point of view but recently when I was using AJAX ( DWR framework specifically ), I realized that either I am using AJAX wrongly or the AJAX doesn't exactly meet the requirements for developing complex web pages on the fly.
In the beginning I thought it may be performance intensive but theoretically JSP engine does so many things to JSP pages so it can't be slower than JSP page processing if I apply the same JSP engine to process HTML pages that are output by AJAX frameworks.
I have recently done some work on this and I am not disappointed. The performance of the application is atleast better than what I thought.
There will be no resource collission when using expression framework to process expressions in an HTML because the base object in expressions will still be picked from JSF managed beans ( that have a session scope ).
Hope this clarifies to some extent the approach that I have taken.
-Ashish
[ July 30, 2007: Message edited by: Ashish Sarin ]