| 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
|
 |
saahil gupta
Ranch Hand
Joined: Dec 26, 2011
Posts: 56
|
|
|
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
Saloon Keeper
Joined: Oct 27, 2005
Posts: 18370
|
|
|
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
How To Ask Questions How To Answer Questions
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 12513
|
|
|
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
|
One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
|
 |
 |
|
|
subject: How to give a path name in web.xml
|
|
|