✔ SERVLET CHAPTERS:-
1. Servlet Arctitecture Overview
2. Life cycle of Servlet
3. Servlet Interface
4. Generic Servlet Class
5. Http Servlet Class
6. Deployment Descriptor Webxml
7. Welcome File List In Webxml
8. Load On Startup in Webxml
9. Request Dispatcher Interface
10. Sendre Direct In Servlet
11. Servlet init Parameters
12. Servlet context Parameters
13. Servlet Hello World Example
14. Session Management Cookies
15. Cookie in Servlet
16. Hidden Field In Servlet
17. URL rewriting In Servlet
18. Http session In Servlet
19. Servlet Filter In Java
20. Filter Config Interface
1. Servlet Arctitecture Overview
2. Life cycle of Servlet
3. Servlet Interface
4. Generic Servlet Class
5. Http Servlet Class
6. Deployment Descriptor Webxml
7. Welcome File List In Webxml
8. Load On Startup in Webxml
9. Request Dispatcher Interface
10. Sendre Direct In Servlet
11. Servlet init Parameters
12. Servlet context Parameters
13. Servlet Hello World Example
14. Session Management Cookies
15. Cookie in Servlet
16. Hidden Field In Servlet
17. URL rewriting In Servlet
18. Http session In Servlet
19. Servlet Filter In Java
20. Filter Config Interface
Send Redirect in Servlet: Previous Next: Servlet Context Parameters
Servlet Init parameters and ServletConfig interface
Init parameters:
Init parameters refers to the initialization parameters of a servlet or filter. attribute is used to define a init parameter. attribute has two main sub attributes and . The contains the name of the parameter and contains the value of the parameter.
ServletConfig interface:
ServletConfig interface is used to access the init parameters.
Methods of ServletConfig interface:
1. getInitParameter(String name): Returns the value of the specified parameter if parameter exist otherwise return null.
Syntax: public String getInitParameter(String name)
2. getInitParameterNames(): Returns the names of init parameters as Enumeration if servlet has init parameters otherwise returns an empty Enumeration.
Syntax: public Enumeration getInitParameterNames()
3. getServletContext():Returns an instance of ServletContext.
Syntax: public ServletContext getServletContext()
4. getServletName():Returns the name of the servlet.
Syntax: public String getServletName()
Example:
InitParamExample.java
");
out.close();
}
}
web.xml