• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between env-entry and context init parameter

 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic