Results 1 to 2 of 2
  1. #1
    mary is offline Member
    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    0

    Default java.net.MalformedURLException

    I've been trying to load an XSL file from the classpath, this is my code

    Java Code:
    getClass().getClassLoader().getResourceAsStream("fileexample.xsl")
    But the stream is coming back as Null and I'm getting a java.net.MalformedURLException.
    Do you have any ideas?

  2. #2
    tommy is offline Member
    Join Date
    Jul 2007
    Posts
    41
    Rep Power
    0

    Default

    Try this:
    Java Code:
    Thread.currentThread().getContextClassLoader().getResource("file.xsl");
    or this:
    Java Code:
    Thread.currentThread().getContextClassLoader().getResource("/file.xsl");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •