I used the ‘Copy’ command in xwiki to create a page, but didn’t specify the Copy location. It then created pages at the root of xwiki with forward slashes.
If you can, make the modification to Tomcat. You do not have to delete the page; instead you can rename it / move it to the place where you want to have it.
If for some reason you cannot change the tomcat configuration then the code snippet to delete the page programmatically is the remaining option. (I think one can move/rename the page instead as well.)
Hi Daniel. I’d like more information in order to reproduce this.
Can you give the URL of a page on which you did the copy action?
You cannot not specify a location since by default the location is the current page. Can you explain in more details what you mean by “didn’t specify the Copy location”? FTR here’s what I see when I try the copy on A/B/C/:
And if you don’t change the “copy location” you’ll get a warning message that “Warning: The page A.B.C.WebHome already exists. Are you sure you want to overwrite it (all its content would be lost)?”. Did you get that and still clicked “copy”?
FTR just tested on a badly configured Tomcat (i.e. where / and \ are forbidden) and the copy of A/B/C/ to itself was ok (no slashes added). Maybe you had “/” or “” characters in one of the pages that you copied?
In relation to another question you mentioned ‘… Can you explain in more details what you mean by “didn’t specify the Copy location”? FTR here’s what I see when I try the copy on A/B/C/…’
For this I changed the page name, but I forgot to change the copy location and then I used the copy button.
Actually you do You mentioned the following 2 URLs:
And
The %2F character means a /.So if your Tomcat wasn’t properly configured that could explain the problems you had.
Have you changed the Tomcat config to support ‘/’ and '`?
Yes but when you do this, you get a warning saying that you’re going to overwrite a page… So it means you also clicked “copy” to overwrite the page I guess
I’ll try to find the time to retry with a badly configured Tomcat and a page having a “/” in the name.
In any case if you’ve configured Tomcat correctly, you shouldn’t have the problem anymore.