View | Details | Raw Unified | Return to bug 34034
Collapse All | Expand All

(-)jasper2/src/share/org/apache/jasper/compiler/JspConfig.java (-5 / +13 lines)
Lines 19-26 Link Here
19
import java.io.InputStream;
19
import java.io.InputStream;
20
import java.util.Iterator;
20
import java.util.Iterator;
21
import java.util.Vector;
21
import java.util.Vector;
22
import java.net.URL;
22
23
23
import javax.servlet.ServletContext;
24
import javax.servlet.ServletContext;
25
import org.xml.sax.InputSource;
24
26
25
import org.apache.commons.logging.Log;
27
import org.apache.commons.logging.Log;
26
import org.apache.commons.logging.LogFactory;
28
import org.apache.commons.logging.LogFactory;
Lines 60-73 Link Here
60
	InputStream is = null;
62
	InputStream is = null;
61
63
62
        try {
64
        try {
63
            is = ctxt.getResourceAsStream(WEB_XML);
65
        	URL uri = ctxt.getResource(WEB_XML);
64
	    if (is == null) {
66
        	if (uri == null) {
65
	        // no web.xml
67
	        // no web.xml
66
	        return;
68
	        return;
67
	    }
69
	    }
68
70
69
	    ParserUtils pu = new ParserUtils();
71
            is = uri.openStream();
70
	    TreeNode webApp = pu.parseXMLDocument(WEB_XML, is);
72
            InputSource ip = new InputSource(is);
73
        	ip.setSystemId(uri.toExternalForm());
74
        	
75
        	ParserUtils pu = new ParserUtils();
76
        	TreeNode webApp = pu.parseXMLDocument(WEB_XML, ip);
77
        	
71
	    if (webApp == null
78
	    if (webApp == null
72
                    || !"2.4".equals(webApp.findAttribute("version"))) {
79
                    || !"2.4".equals(webApp.findAttribute("version"))) {
73
	        defaultIsELIgnored = "true";
80
	        defaultIsELIgnored = "true";
Lines 173-179 Link Here
173
                    jspProperties.addElement(propertyGroup);
180
                    jspProperties.addElement(propertyGroup);
174
                }
181
                }
175
            }
182
            }
176
        } finally {
183
                    } catch (Exception ex) {
184
            	           throw new JasperException(ex);        } finally {
177
            if (is != null) {
185
            if (is != null) {
178
                try {
186
                try {
179
                    is.close();
187
                    is.close();
(-)jasper2/src/share/org/apache/jasper/xmlparser/ParserUtils.java (-3 / +17 lines)
Lines 73-84 Link Here
73
     * that corresponds to the root node of the document tree.
73
     * that corresponds to the root node of the document tree.
74
     *
74
     *
75
     * @param uri URI of the XML document being parsed
75
     * @param uri URI of the XML document being parsed
76
     * @param is Input stream containing the deployment descriptor
76
     * @param ip Input source containing the deployment descriptor
77
     *
77
     *
78
     * @exception JasperException if an input/output error occurs
78
     * @exception JasperException if an input/output error occurs
79
     * @exception JasperException if a parsing error occurs
79
     * @exception JasperException if a parsing error occurs
80
     */
80
     */
81
    public TreeNode parseXMLDocument(String uri, InputStream is)
81
    public TreeNode parseXMLDocument(String uri, InputSource ip)
82
        throws JasperException {
82
        throws JasperException {
83
83
84
        Document document = null;
84
        Document document = null;
Lines 92-98 Link Here
92
            DocumentBuilder builder = factory.newDocumentBuilder();
92
            DocumentBuilder builder = factory.newDocumentBuilder();
93
            builder.setEntityResolver(entityResolver);
93
            builder.setEntityResolver(entityResolver);
94
            builder.setErrorHandler(errorHandler);
94
            builder.setErrorHandler(errorHandler);
95
            document = builder.parse(is);
95
            document = builder.parse(ip);
96
	} catch (ParserConfigurationException ex) {
96
	} catch (ParserConfigurationException ex) {
97
            throw new JasperException
97
            throw new JasperException
98
                (Localizer.getMessage("jsp.error.parse.xml", uri), ex);
98
                (Localizer.getMessage("jsp.error.parse.xml", uri), ex);
Lines 116-121 Link Here
116
    }
116
    }
117
117
118
118
119
    /**
120
     * Parse the specified XML document, and return a <code>TreeNode</code>
121
     * that corresponds to the root node of the document tree.
122
     *
123
     * @param uri URI of the XML document being parsed
124
     * @param is Input stream containing the deployment descriptor
125
     *
126
     * @exception JasperException if an input/output error occurs
127
     * @exception JasperException if a parsing error occurs
128
     */
129
    public TreeNode parseXMLDocument(String uri, InputStream is)
130
        throws JasperException {
131
    	return (parseXMLDocument(uri, new InputSource(is)));
132
    }
119
    // ------------------------------------------------------ Protected Methods
133
    // ------------------------------------------------------ Protected Methods
120
134
121
135

Return to bug 34034