myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Udo Schnurpfeil <...@schnurpfeil.de>
Subject JSF 2.0 vs. Servlet 3.0: inconsistency with the resources directory?
Date Wed, 20 May 2009 12:17:16 GMT
Hi there,

I think I've found a inconsistency between JSF 2.0 and Servlet API 3.0
with respect to the resources management.

JSF 2.0 (PFDC 20090327): Resources are located in the web-app root under

    /resources      (Section 2.6.1.1)

or in a jar file under

    /META-INF/resources     (Section 2.6.1.2)

Servlet 3.0 (PFD April 2009): Resources are located in the web-app root
under

    /      (always)

or in a jar file under

    /META-INF/resources     (Section 4.6)

As you can see, the path in the jar-files are the same, but the path
under the web-app root is different.
That may provoke some problems while dealing with the resources for
application developer and library developer.

Example: writing a JSF tag using an image as resource: welcome.png

When I put the image in a jar: /META-INF/resources/welcome.png can be
found by JSF and by the servlet container (to load the image into the
browser) under the same path. The renderer has to write the URL quite
simple: <contextPath>/welcome.png

When I put the image in the web-app root (under /resources), the JSF
component renderer has to add the resources directory manually:
<contextPath>/resources/welcome.png

But the renderer normally doesn't know about the real position of the
resource (and that is good, of course).


Has anybody have some comments about this?

Regards,

Udo




Mime
View raw message