Created
June 23, 2011 21:12
-
-
Save anonymous/1043644 to your computer and use it in GitHub Desktop.
URL handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| java.lang.IllegalStateException: Illegal class loader binding | |
| org.apache.naming.resources.DirContextURLStreamHandler.get(DirContextURLStreamHandler.java:223) | |
| org.apache.naming.resources.DirContextURLStreamHandler.openConnection(DirContextURLStreamHandler.java:88) | |
| java.net.URL.openConnection(URL.java:945) | |
| test.TestServlet.doGet(TestServlet.java:19) | |
| javax.servlet.http.HttpServlet.service(HttpServlet.java:734) | |
| javax.servlet.http.HttpServlet.service(HttpServlet.java:847) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TestServlet extends HttpServlet { | |
| @Override | |
| protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | |
| URL resourceUrl = req.getSession().getServletContext().getResource("/myresources/simple.resource"); | |
| URL copyUrl = new URL(resourceUrl.toExternalForm()); | |
| copyUrl.openConnection(); | |
| System.out.println("it worked"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment