Tomcat for Windows WebApp deletion problem?
On a Win2K box, I had a Struts application in it's own context. Tomcat 4.1.27 and IIS 5 using JK2. Because the JSP pages needed access to files that were normally served up by the IIS Server, I created a Junction (Windows/NTFS 5.0's version of a Symbolic Link) to the directories I needed. Worked great, installing was the following steps: Stop Tomcat. Delete the old context's directory, Move the new war file over Restart Tomcat Recreate the Junctions the WebApp needed. Well, last night, I tried to use the web interface to remove the WebApp. And THEN discovered that doing it this way *deleted* the contents of the linked directories. I was pretty sure it hadn't happened fore, so I re-tested it out in Windows Explorer and it does NOT do this. The linked directories are not touched. -Joe, finding the backups of the include and images directories. (I'm not on this list. Any questions, please respond to me directly). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Directory Creation in Servlet Question
I have a Struts Servlet that executes the code snippet below to create a directory. Under Windows, this works great, the directory showing up under C:\TOMCAT4\WEBAPPS\ Under Suze Linux, it doesn't get created, and it's not a permission problem. At least not under the webapps directory. The Tomcat user can definitely create a directory there (I've su'd to him and done it). What should I be looking at next? String filePath = File.separator + userId; File dirs = new File(File.separator + rs.getMessage(imageFilePath) + filePath); dirs = new File(File.separator + rs.getMessage(imageFilePath) + filePath); if (!dirs.exists()) { dirs.mkdirs(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Directory Creation in Servlet Question
In Windows that's what it means too, but this isn't Windows or Linux...it's a JVM. Since it wasn't obvious from the code (MessageResources used in pathnames), let me put it another way. The code tries to create a directory /images/userid. The Servlet is apparently limited in the filepath it gets to work with. I'd expect that. In Windows, Tomcat executes it and it goes to C:\tomcat4\images\userid In my Suze install, Tomcat the analogous directory /opt/tomcat4/webapps/images I didn't check to see if it's *different* because in the code it won't be. It's the same identifier working off of root. Windows Tomcat puts it under it's webapps tree. I'm expecting Suze to do the same. I have a hard time imagining that Tomcat gets a different view of its root file system depending on which OS I runs on. It really ruins the concept of platform independence for this sort of thing. -Joe you tried to debug it. You can check what is the path before the directory is created. In Linux / means the root directory and since the path name begins with File.separator(/), the file is created with reference to /. For eg. if filePath is /anto. Then if Tomcat have write permission to root directory the directory will be created. -- rgds Anto Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Directory Creation in Servlet Question
If you want to get the absolute path of the application directory use ServletContext.getRealPath(/); and pass this to the file creating code. Yes, I could, but this again didn't explain the behavior which turned out to be: Try to create \images in a servlet running under Windows Tomcat, it becomes C:\tomcat4\webapps\images. Try to create /images in a servlet running under Suze and it becomes /images. I would expect to have to be /images in Windows too, except it didn't work that way. Okay, so Tomcat effects a chroot somehow. But I then expected it to continue under Suze and was dissapointed. I strongly suspect that what you describe will not work under Windows Tomcat even though it should - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Directory Creation in Servlet Question
If you want to get the absolute path of the application directory use ServletContext.getRealPath(/); and pass this to the file creating code. Yes, I could, but this again didn't explain the behavior which turned out to be: Try to create \images in a servlet running under Windows Tomcat, it becomes C:\tomcat4\webapps\images. Try to create /images in a servlet running under Suze and it becomes /images. I would expect to have to be /images in Windows too, except it didn't work that way. Okay, so Tomcat effects a chroot somehow. But I then expected it to continue under Suze and was dissapointed. I strongly suspect that what you describe will not work under Windows Tomcat even though it should - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]