• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to give a path name in web.xml

 
phoenix raising
Greenhorn
Posts: 3
Android Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your Code here.
 
phoenix raising
Greenhorn
Posts: 3
Android Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Pie
Posts: 20559
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic