Skip to content

Commit 6928063

Browse files
committed
Clean-up.
Extracted from a patch by Jeremy Boynes. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1501304 13f79535-47bb-0310-9956-ffa450edef68
1 parent 7c2cece commit 6928063

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

java/org/apache/jasper/JspC.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
1817
package org.apache.jasper;
1918

2019
import java.io.BufferedReader;
@@ -30,7 +29,6 @@
3029
import java.io.PrintWriter;
3130
import java.io.Reader;
3231
import java.io.Writer;
33-
import java.net.MalformedURLException;
3432
import java.net.URL;
3533
import java.net.URLClassLoader;
3634
import java.util.ArrayList;
@@ -1414,15 +1412,11 @@ protected void completeWebXml() {
14141412
}
14151413
}
14161414

1417-
protected void initServletContext() {
1418-
try {
1419-
context =new JspCServletContext
1420-
(new PrintWriter(System.out),
1421-
new URL("file:" + uriRoot.replace('\\','/') + '/'));
1422-
tldLocationsCache = TldLocationsCache.getInstance(context);
1423-
} catch (MalformedURLException me) {
1424-
System.out.println("**" + me);
1425-
}
1415+
protected void initServletContext() throws IOException {
1416+
// TODO: should we use the Ant Project's log?
1417+
PrintWriter log = new PrintWriter(System.out);
1418+
URL resourceBase = new File(uriRoot).getCanonicalFile().toURI().toURL();
1419+
context = new JspCServletContext(log, resourceBase);
14261420
rctxt = new JspRuntimeContext(context, this);
14271421
jspConfig = new JspConfig(context);
14281422
tagPluginManager = new TagPluginManager(context);

0 commit comments

Comments
 (0)