File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes difference between env-entry and context init parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "difference between env-entry and context init parameter" Watch "difference between env-entry and context init parameter" New topic
Author

difference between env-entry and context init parameter

ajse ruku
Ranch Hand

Joined: May 06, 2005
Posts: 193
Hi all,
I want to know the difference between env-entry tag and context init parameter tag
mentioned in the web.xml.As both the tags are used to pass the variables to the servlet.

with regards,
ajse
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

The env-entry element is used to get some resource via JNDI.
From the spec:
The name is a JNDI name relative to the java:comp/env context.
The name must be unique within a web application.

On the other hand, the value you define in context init can be used directly to retrieve a defined value.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: difference between env-entry and context init parameter
 
Similar Threads
Accessing parameter from web.xml inside a MessageResource class
tomcat JNDI bug????
context init parameters
servlet context
Question on ServletContext