Hi Phil,

if you make changes to web.xml env-entries and stop/start the application 
using the manager app, do your changes show up? My changes didn't show up, 
only after a complete restart of the Tomcat Container.

thx
Johannes




"Rhodes, Phil" <[EMAIL PROTECTED]> 
28.03.2003 15:26
Please respond to
"Tomcat Users List" <[EMAIL PROTECTED]>


To
"Tomcat Users List" <[EMAIL PROTECTED]>
cc

Subject
RE: Possible values in web.xml - Reference??






From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Is there any reference available with samples what can be stored in 
> web.xml and how to access the property?
> In the examples context I found the following entries in web.xml:
> 
>     <env-entry>
>       <env-entry-name>name3</env-entry-name>
>       <env-entry-value>1</env-entry-value>
>       <env-entry-type>java.lang.Integer</env-entry-type>
>     </env-entry>
> 
> How can I access these values? Are these accessible using 
> servletcontext.getInitParameter("name3")? Is it getting 
> casted to Integer 
> automatically?

Try something like this:

import javax.naming.Context;
import javax.naming.InitialContext;
...
Context initialContext = null;
try {
                 initialContext = new InitialContext();
}
catch (Exception e) {
      out.print("<li>Cannot get initial context for JNDI: ");
      out.println(e + "</li>");
                 return;
}
Integer envEntry = null;
try {
                 envEntry = (Integer) 
initialContext.lookup("java:comp/env/name3");
} 
catch (Exception e) {
                 out.println("<li>Cannot get env-entry on JNDI " + e + 
"</li>");
      return;
}
...

See  http://www.objectweb.org/jonas/current/doc/PG_War.html for a more
complete explanation - it really helped me.

-Phil


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to