[
https://jira.jboss.org/jira/browse/JBSEAM-3366?page=com.atlassian.jira.pl...
]
Thomas März reopened JBSEAM-3366:
---------------------------------
Actually I can't reproduce the bug on Windows, too, but if I print the resource-names
in Resources#getResourceAsStream(String, ServletContext) I get e. g. the follwing
resource-names:
/WEB-INF/pages.xml
customer/photo/list.page.xml
general/login/index.page.xml
/WEB-INF/pages.xml
customer/photo/list.page.xml
general/login/index.page.xml
/WEB-INF/pages.xml
customer/photo/list.page.xml
Line 149 in Pages.java:
InputStream stream = ResourceLoader.instance().getResourceAsStream(fileName);
The fileName does not start with a / and the spec for ServletContext says:
java.io.InputStream getResourceAsStream(java.lang.String path)
The path must be specified according to the rules given in getResource. This method
returns null if no resource exists at the specified path.
java.net.URL getResource(java.lang.String path) throws java.net.MalformedURLException
Returns a URL to the resource that is mapped to a specified path. The path must begin with
a "/" and is interpreted as relative to the current context root.
org.jboss.seam.util.Resources#getResourceAsStream() fails with newer
versions of Tomcat, page.xml files aren't found
--------------------------------------------------------------------------------------------------------------------
Key: JBSEAM-3366
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3366
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.1.0.BETA1
Environment: Tomcat 6.0.16 on Fedora
Reporter: Thomas März
Assignee: Pete Muir
Fix For: 2.1.0.CR1
With <core:init debug="true" /> the reloading of page.xml files fails
with the log entry:
no pages.xml file found: customer/phot/list.page.xml
And since the resource doesn't start with a slash, list.page.xml can't be
loaded.
Quoted from
https://issues.apache.org/bugzilla/show_bug.cgi?id=43241
Say for example, you have a file style.css deployed in your context. The call to
ServletContext.getResourceAsStream("style.css") returns an input stream. This
is
not correct behavior.
The spec (2.3) says:
> The path must be specified according to
> the rules given in getResource.
getResource() says:
> The path must begin with a "/" and is interpreted
> as relative to the current context root.
My reading of these two things is that getResourceAsStream("style.css") should
return null, not an input stream to the file.
I got bit on this because my app behavior changed (broke) when ran on the
current version of WebSphere.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira