aspose file tools*
The moose likes Tomcat and the fly likes How to give a path name in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to give a path name in web.xml" Watch "How to give a path name in web.xml" New topic
Author

How to give a path name in web.xml

phoenix raising
Greenhorn

Joined: Jan 07, 2012
Posts: 3

Hi in my project for uploading a image i have given path in web.xml as this runs in my system.

But when i host the site i need to give the path name of the directory from the server How can i give the path name in web.xml. if anyone dont understand my question give reply.thanks in advance
Ifteqar Ald
Ranch Hand

Joined: Dec 26, 2011
Posts: 73
Can you post your Code here.
phoenix raising
Greenhorn

Joined: Jan 07, 2012
Posts: 3



This code works in local system as i have given absolute path.
When i hosted the site in server i have given the path as /image/ and it is available im my root directory. But it is not working as it shows error the path is not found as i also tried with webapps/cloud1_1_1/image as it is shown in ftp . Can anyone rectify it. Thanks in advance.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

The right approach would be to specify a path relative to the web application, then use ServletContext.getRealPath to turn it into an absolute path.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16068
    
  21

I can provide some practical solutions, but not to "phoenix raising". We don't have many rules here, but this one is critical: http://www.javaranch.com/name.jsp


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to give a path name in web.xml