tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34465] - jasper2 fails when there is no web.xml
Date Fri, 15 Apr 2005 09:28:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34465>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34465





------- Additional Comments From Yoichi.Hirose@fujixerox.co.jp  2005-04-15 11:28 -------
(In reply to comment #6)
> Anyway, look in org.apache.jasper.servlet.JspCServletContext.

As you said, I looked at JspCServletContext#getRealPath and
JspCServletContext#getResource. They just generates a new URL, and does not
check the existents of the actual file.

In 5.5.7, getResourceAsStream was used insted of getResource, and the
implementation of getResourceAsStream is as below.

    public InputStream getResourceAsStream(String path) {

        try {
            return (getResource(path).openStream());
        } catch (Throwable t) {
            return (null);
        }

    }

Since Throwable is caught, FileNotFoundException will not be raised to
processWebDotXml.

Well the easiest way to fix this problem, is modifiy
	    is = uri.openStream();
to
	    try {
		is = uri.openStream();
	    } catch (java.io.FileNotFoundException ex) {
		return;
	    }
or maybe catch a Throwable, as it does in getResourceAsStream.

I modified JspConfig.java on my local machine as above, and it correctly worked
as I wanted.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message