• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to give a path name in web.xml

 
Greenhorn
Posts: 3
Android Netbeans IDE Firefox Browser
  • 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
 
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 Netbeans IDE Firefox Browser
  • 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.
 
Sheriff
Posts: 21760
102
Eclipse IDE Spring VI Editor Chrome Java Ubuntu 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.
 
Bartender
Posts: 20847
125
Android Eclipse IDE Tomcat Server Redhat Java 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
Boost this thread!