Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use of deprecated toUrl method makes sitemesh unable to load sitemesh.xml (and possibly other files) #18

Open
yortx opened this Issue · 2 comments

2 participants

@yortx

Sitemesh uses the deprecated ".toURL" method to get streams to read files, which warns that special and illegal URL characters are not escaped. I'd like to use the special character '#' in the war name, so that tomcat deploys it to a subfolder, but after converting the path to the sitemesh.xml file to an URL, it's interpreted as an anchor, and it can't load the config files.

The solution is just to replace the call to .toUrl in the file objects to the suggested in the deprecated comment: "toURI().toURL()".

@yortx yortx referenced this issue from a commit in yortx/sitemesh2
Jorge Barreiro Fix the use of deprecated method .toURL in File objects. Fixes issue #18
.
9114e3c
@yortx yortx referenced this issue
Open

Fixes issue #18 #19

@ghorstm

The fix doesn't really help as it still wants to make an URL from a file that is already confirmed to exist an be readable.
Why not just make a
is = new FileInputStream(configFile);
this works with paths that have the special char "#" in them.

@ghorstm

ok, had a small other problem here, toURI().toURL() works for the "#" issue, but do we really need it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.