Context init parameters to the rescue

Context init parameters work just like servlet init parameters, except context parameters are available to the entire webapp, not just a single servlet. So that means any servlet and JSP in the app automatically has access to the context init parameters, so we don’t have to worry about configuring the DD for every servlet, and when the value changes, you only have to change it one place!

In the DD (web.xml) file:

image with no caption

In the servlet code:

image with no caption

OR:

image with no caption
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset