On 04/18/2012 12:54 PM, Martin Evans wrote:
I currently have two spaces, one called
"Environment And Sustainability"
and the other called "Environment+And+Sustainability". If I try to delete
the only page in the erroneous space it says "The requested document could
not be found". So if the page isn't there, why is the space there?
Some containers perform a double decoding of the URL, I noticed that in
Tomcat, for example. Normally, + is considered an encoding for the space
character in URLs. This means that an URL containing + actually refers
to spaces. We get around this by actually encoding the + character with
its proper URL escape, %2B, and this should be properly decoded back
into +, except on Tomcat, where this + is decoded one more time into a
space. So while the browser asks for the
"Environment%2BAnd%2BSustainability" URL, which corresponds to the
"Environment+And+Sustainability" space, Tomcat converts that into
"Environment And Sustainability". Your only chance is to delete it from
a script:
{{velocity}}
$xwiki.getDocument('Name of document').delete()
{{/velocity}}
Replace 'Name of document' with the exact document name, something like
'Environment+And+Sustainability.WebHome'.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/