Sylvain,

I was very interested in what you have done and had a look at your enhancements and it's cool stuff! Anyway I committed some modifications because of i18n issues and (hopefully) to improve performance a little bit. And there are two points I would like to discuss:

1) IMHO resource delivery and multipart handling should not be mixed up in one filter. I understand your intentions to keep configuration simple but serving embedded javascript and css resources has nothing in common with multipart requests so we should keep these two aspects separated. It think we can ask our users to add an additional servlet filter to their web.xml for the benefit of simplified JSP and a simplified packaging process.

2) I would move resource delivery from the filter to a servlet so the filter just has to wrap the response object and perform the post-processing of the response. The advantage of a servlet-based solution is reduced server load. If getLastModified() is implemented in a usefull manner we don't have to stream a resource again if the browser already has the latest version. Another servlet would require for another servlet and servlet-mapping entry in web.xml, but again the benefit should be worth the effort to any user.

So what do you think?

Oliver


Sylvain Vieujot wrote:

Yes, that's exactly what I'm doing.
When the code is comited, please review it though, because I'm not sure I'm 100% correct in the setContentType, and all the i8n stuffs.


Sylvain.

On Wed, 2004-12-01 at 19:29 +0100, Manfred Geiler wrote:

Sylvain Vieujot wrote:
Ok, it works fine for the javascripts with the new filter.

For the CSS, I'm working on a solution "a la SiteMesh" ( http://www.opensymphony.com/sitemesh/ ).
This means in the filter, we capture the response, and before rendering it, we include the relevant <link>, ... in the header.

You could even wrap the response and redirect the standard response Writer through a special Writer, that includes the relevant <link> tags into the stream, before actually streaming it back to the client.


As SiteMesh is known to have quite good performance, I think it's an acceptable solution.

Any thoughts on this approach ?

Cool solution, yes of course!

Manfred




--
Oliver Rossmueller
Software Engineer and IT-Consultant
Hamburg, Germany
http://www.rossmueller.com



Reply via email to