This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 194
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