Thanks,<br />Gnanam<br /> <br />SCJP1.4 90,SCWCD 88
Bhavik Patel
Glassfish Consultancy service At http://www.jmatrix.in
Originally posted by Gnanam Meenakshi Sundaram:
To write the file using filewriter if I have to give the full path without hardcoding it.
For eg.
D:/SDE3.0/workspace/project/WebContent/WEB-INF/classes/com/files/user.xml
when I tried to get this path URL using getClass().getClassLoader().getResource("com/files/user.xml") , i get
C:/Program Files/SDE3.0/tomcat-5.5.16/webapps/Request/WEB-INF/classes/com/files/user.xml
It would probably be a good idea to move that file outside your web project and configure its location via a configuration parameter
Thanks,<br />Gnanam<br /> <br />SCJP1.4 90,SCWCD 88
can you jus tell me why do you need the file in your development structure to be muniplated by your web application....?
dont you think the worspace folder structure will not exist where you are going to deploy your application...?
]
Thanks,<br />Gnanam<br /> <br />SCJP1.4 90,SCWCD 88
can you jus tell me why do you need the file in your development structure to be muniplated by your web application....?
dont you think the worspace folder structure will not exist where you are going to deploy your application...?
]
Thanks,<br />Gnanam<br /> <br />SCJP1.4 90,SCWCD 88
Originally posted by Gnanam Meenakshi Sundaram:
. . .But it loads the file from my workspace directory. . .
Originally posted by Gnanam Meenakshi Sundaram:
Could you please reply me how to configure the location of a file outside webapp via a configuration parameter.
Originally posted by Joe Ess:
it appears that getResourceAsStream() is returning the workspace file but getResource() returns the path to the deployed file. That just doesn't seem possible. How do you know that the file loaded by getResourceAsStream() is the workspace file?
Thanks,<br />Gnanam<br /> <br />SCJP1.4 90,SCWCD 88
I think she's lovely. It's this tiny ad that called her crazy:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
|