What is a config Object in JSP?

JSPJava 8Object Oriented ProgrammingProgramming

The config object is an instantiation of javax.servlet.ServletConfig and is a direct wrapper around the ServletConfig object for the generated servlet.

This object allows the JSP programmer access to the Servlet or JSP engine initialization parameters such as the paths or file locations etc.

The following config method is the only one you might ever use, and its usage is trivial −


This returns the servlet name, which is the string contained in the <servlet-name> element defined in the WEB-INF\web.xml file.

Updated on 30-Jul-2019 22:30:25