You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Juan Antonio Gonzalez Ramos <ju...@gugu.usal.es> on 2000/04/06 17:48:00 UTC

Files .properties

Where should I put the .properties files ?

I'm trying to run dbBrowse servlets, and they uses 2 properties files, but I don't know where to put them.

Can anybody help me ?

    Juan Antonio González Ramos
    Universidad de Salamanca

Re: Files .properties

Posted by Jun Inamori <j-...@osa.att.ne.jp>.
Hello Juan,

Assuming that the properties files you'd like to put are required for
your servlet, not for the Tomcat related classes, it is not the subject
for this mailing list.

You seem to pass some values to your servlet and you'd like to write
such values in the configuration files rather than hard-coded in your
servlet. In such a case,  you can use the DOC_BASE/WEB-INF/web.xml file.
The following are the quote from web.dtd :

<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
(servlet-class|jsp-file), init-param*, load-on-startup?,
security-role-ref*)>

<!-- The init-param element contains a name/value pair as an
initialization param of the servlet -->
<!ELEMENT init-param (param-name, param-value, description?)>

<!-- The param-name element contains the name of a parameter. -->
<!ELEMENT param-name (#PCDATA)>

<!-- The param-value element contains the value of a parameter. -->
<!ELEMENT param-value (#PCDATA)>

Through getInitParameterNames() and getInitParameter(String)  of
javax.servlet.GenericServlet, we can retrieve the names and values
specified in web.xml.

I hope this will help you.
Happy Java programming!

Jun Inamori
E-mail: j-office@osa.att.ne.jp
URL:    http://www.oop-reserch.com


Juan Antonio Gonzalez Ramos wrote:
> 
> Where should I put the .properties files ?
> 
> I'm trying to run dbBrowse servlets, and they uses 2 properties files, but I don't know where to put them.
> 
> Can anybody help me ?
> 
>     Juan Antonio González Ramos
>     Universidad de Salamanca