tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elroy, Rebecca" <Rebecca.El...@B.Materna.de>
Subject AW: how to set the path to write files (on the server) from a ser vlet
Date Tue, 06 Nov 2001 14:09:23 GMT

Why not use an servlet init parameter in your web.xml? Your path is then
specified outside your code and you can easily update it.

Example:
  <servlet>
	<servlet-name>yourservlet</servlet-name>
	<servlet-class>your.Servlet</servlet-class>
	<init-param>
	 <param-name>xml_dir</param-name>
	 <param-value>some/path</param-value>
	</init-param>
  </servlet>

Rebecca

-----Urspr√ľngliche Nachricht-----
Von: moro.stefano@inwind.it [mailto:moro.stefano@inwind.it]
Gesendet: Dienstag, 6. November 2001 15:05
An: tomcat-user@jakarta.apache.org
Betreff: how to set the path to write files (on the server) from a
servlet



I'm using Tomcat 4.0 and Apache 1.3.22 and I've the following problem:
when my servlet writes an xml file, it goes in a system directory of NT, so
that I've to write the full path "C:\..." to write this file in the right
directory. It's a problem of course because the full path changes if I
change pc, hard disk and so on...
So, how should I set the path to write files in Tomcat ?
Thanks in advance...

                 Stefano Moro


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message