You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2001/12/19 11:03:11 UTC

DO NOT REPLY [Bug 5504] New: - Can't read enviroment entries defined in applications web.xml

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5504>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5504

Can't read enviroment entries defined in applications web.xml

           Summary: Can't read enviroment entries defined in applications
                    web.xml
           Product: Tomcat 4
           Version: 4.0.1 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: pkor@eurocom.gr


I want to define an enviroment entry in my web app's web.xml.
As stated in the documentation (http://jakarta.apache.org/tomcat/tomcat-4.0-
doc/config/context.html#Environment%20Entries) i can eiher do it in my 
applications web.xml or in the server.xml.
I choose to do it in my application's web.xml with the above xml fragment:

<env-entry>
      <env-entry-name>foo/Name</env-entry-name>
      <env-entry-value>xxx</env-entry-value>
      <env-entry-type>java.lang.String</env-entry-type>
</env-entry>

and i saw that using the above code i couldn't retrieve the value.

Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup("java:comp/env");
String temp = (String)envCtx.lookup("foo/Name");

then using the above xml fragment in my server.xml solved it.
<Environment name="foo/Name" type="java.lang.String" value="xxx"/>

What should i do to retrieve the value from the web.xml without defining it to 
server.xml?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>