Forums Register Login

web.xml

+Pie Number of slices to send: Send
With the help of web.xml in web-inf directory is it possible to specify a default file read write delete location independent of using Tomcat or Serveltexec or Jrun.
I need this for servlet/jsp to write/read xml,xsl files.
Regards
Balaji
+Pie Number of slices to send: Send
Am I in the blacklist or something,why no one is replying to me ??
Regards
Balaji
+Pie Number of slices to send: Send
Hi,
If i write a file in servlet using Tomcat its creating the file at tomcat\bin directory.
Using ServletExec its creating the file at c:\winnt\system32 directory


Is it possible to make it at single location using either web.xml or servlet init parameters.

Regards
Balaji
+Pie Number of slices to send: Send
Am I in the blacklist or something,why no one is replying to me ??
I don't think it's personal. I think a lot of people just didn't understand your question, and hoped someone else would answer it. Your second explanation seems clearer, so I'll have a stab at it.
If i write a file in servlet using Tomcat its creating the file at tomcat\bin directory.
Using ServletExec its creating the file at c:\winnt\system32 directory. Is it possible to make it at single location using either web.xml or servlet init parameters.

There is no requirement in the servlet specification for a container to set the "current directory" for file access to anything in particular. However, there are two ways round this.
If all you need is somewhere to put "temporary files", the the container must provide some sort of writable temporary directory, and put a File object for it in the "javax.servlet.context.tempdir" context attribute.
If you need something more permanent, you will need to configure it using some sort of init parameter. In your web.xml file you could put something like:

The you can create a "workdir" File object to represent this directory using comething like:

Has this helped ?
[/code]
+Pie Number of slices to send: Send
Yes Frank it helped and worked for me!
Now i have decided to use request.getContextPath() than hardcoding at c:\data.
Sorry i was so upset trying this,thats why i wrote like that,also i'm switching from Tomcat to Serveltexec,got lost on many things.
Now I'm okay.
Thanks again.
Regards
Balaji
It was the best of times. It was the worst of times. It was a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 794 times.
Similar Threads
Tracking users and user security
(/axis/servlet/AdminServlet) is not available.
doubt in run the servlet in tomcat 5.5
Context Parameters
Accessing parameter from web.xml inside a MessageResource class
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:41:41.