Re: DO NOT REPLY [Bug 34465] - jasper2 fails when there is no web.xml
My question on this thread. Is it legal to precompile JSPs via Jasper2 when there is no web.xml ? On 4/15/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 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 [EMAIL PROTECTED] 2005-04-15 11:22 --- Well jasper2 could put jsp directive outside web.xml when pre-compiling : see this ant example: jasper2 validateXml=false uriroot=${build.dir}/jspc/myapp webXmlFragment=${build.dir}/dst/$myapp/WEB-INF/jsp.xml outputDir=${build.dir}/${wnamei}-src javaEncoding=ISO-8859-1 trimSpaces=true / jasper2 jspc will put the jsp URI in jsp.xml, you could at a later time include in web.xml using !ENTITY jsp SYSTEM jsp.xml and jsp.xml; ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; [ !ENTITY jsp SYSTEM jsp.xml ] web-app jsp; /web-app Be carefull jsp; should be in the servlet-mapping area of your web.xml -- 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DO NOT REPLY [Bug 34465] - jasper2 fails when there is no web.xml
Well the patch seems reasonable to be commited. Could I Remy ? On 4/15/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 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 [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DO NOT REPLY [Bug 34465] - jasper2 fails when there is no web.xml
Henri Gomez wrote: Well the patch seems reasonable to be commited. Could I Remy ? It's a bad patch. getResource should return correct results instead. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DO NOT REPLY [Bug 34465] - jasper2 fails when there is no web.xml
Yes, do you plan a fix ? On 4/15/05, Remy Maucherat [EMAIL PROTECTED] wrote: Henri Gomez wrote: Well the patch seems reasonable to be commited. Could I Remy ? It's a bad patch. getResource should return correct results instead. Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]