Init Parameters to the rescue

You’ve already seen the request parameters that can come over in a doGet() or doPost(), but servlets can have initialization parameters as well.

In the DD (web.xml) file:

image with no caption

In the servlet code:

image with no caption

Get Head First Servlets and JSP, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.