Why
would you want to write to your WEB-INF/classes directory?
This
directory is part of your "war" file and could potentially be literally your
webapp.war file itself. ie not a true directory.
In our
environment, we do not allow anything in the ear/war directory structure to be
changed at run time. If we did, we could not guarentee that we could "back off"
to a functional release the application in the event that a serious problem is
found in the production environment.
This
directory structure really constitutes an application "build", or "version".
John Zerbe - Mellon Financial Corp. Information Technology Solutions - Middleware Team
Phone:
412-234-1048 E-Mail:[EMAIL PROTECTED] AIM: 153-1315
try
getServletContext().getRealPath("/WEB-INF/classes/");
this
will give you the fill path to the directtory ...
Regards
guru
Hi all
I have the following problem:
I need to read/write a file for a servlet, both
are in my WEB-INF/classes directory. I use the code below:
String filename="myfile.abc";
File f=new File(filename);
RandomAccessFile raf=new
RandomAccessFile(f);
but it doesn't work, it seems like the file is
created somewhere in memory. Everything works fine when is used in an
ordinary java class.
When I change the filename to be an absolute
path it also works fine:
String
filename="D:\\tomcat\\webapps\\ROOT\\WEB-INF\\classes\\";
....
What am I doing wrong?
With best regards
Thank you in advance
Piotr
Bieganowski DISCLAIMER: The information contained in this e-mail may be confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the e-mail or any information contained therein by any other person is not authorized. If you are not the intended recipient please notify us immediately by returning the e-mail to the originator.
|