What we're talking about here is the modification of the absolute path. If you need the relative path, you just need to change the value of <param-value>UserFiles/</param-value>.
FCKeditor JSP support in general, to configure a large pile, online are similar articles, it is no longer mentioned, how to modify the path of uploading files, but there has been no solution, looking for a half-day, finally only their own whined whined change
Because the FCKeditor default upload path is its own engineering environment,/userfiles, is configured in Web.xml
<init-param> <param-name>baseDir</param-name> <param-value>userfiles/</param-value > * Here's one less/</init-param>
There's no way to change it to an absolute path, so just go to the servlet and find the class Connectorservlet
The parameters obtained in the Init method are not regulated, mainly in the Doget ()
String Currentpath=basedir+typestr+currentfolderstr;
String Currentdirpath = Getservletcontext (). Getrealpath (Currentpath);
This is the original writing to take the current project webcontent under the/userfiles/
Here, change it into
String Currentpath=basedir+typestr+currentfolderstr;
Currentpath=currentpath.replace ('//', '/');
String currentdirpath= "You need to store the absolute path of the file" +currentpath;
such as String currentdirpath= "d:/dweb_box/" +currentpath; * There's one more/
The following should be changed to the original wording as follows
Node Root=createcommonxml (Document,commandstr,typestr,currentfolderstr,request.getcontextpath () +currentPath);
Here, change it into
Node Root=createcommonxml (DOCUMENT,COMMANDSTR,TYPESTR,CURRENTFOLDERSTR, "You need to store files for the relative path of the Tomcat application" +currentpath);
such as Node Root=createcommonxml (document,commandstr,typestr,currentfolderstr, "/dweb_box/" +currentpath);
* and TOMC application of the path= "/dweb_box" correspondence
Currentpath and Currentdirpath in DoPost () method are consistent with Doget
There's only so much to be changed in the servlet.
Look, if you can't see it after uploading the file, it's probably your location. The path to the file is not configured for Tomcat application
As the above example
<context displayname= "Dweb_box" docbase= "D:/dweb_box" path= "/dweb_box" >
</Context>
Please leave a message for me if you have any questions or omissions.