Config object represents the current JSP configuration information, but the JSP page usually does not need to be configured, so there is no configuration information. This object is less used on JSP pages, but is larger in the servlet because the servlet needs to be configured in the Web.xml file to specify configuration parameters.
The Config object is an instance of ServletConfig that is used to obtain configuration parameters by Getinitparameter (String paramname).
The configuration JSP is also done in the Web.xml file, the JSP is configured as a servlet, and the Init-param element is used for the servlet configuration parameter, which can accept param-name and param-value two child elements.
<servlet>
<!--Specify the name of the servlet-->
<servlet-name>config</servlet-name>
<!--Specifies that the page is configured servlet-->
<jsp-file>/xxxx.jsp</jsp-file>
<init-param>
<param-name>name</param-name>
<param-value>value</param-value>
</init-param>
</servlet>
<servlet-mapping>
<!--specifies that the config servlet be configured to the/config path-->
<servlet-name>config</servlet-name>
<url-pattern>config</url-pattern>
</servlet-mapping>
Note: If you want the JSP page to get the information in the Web.xml configuration file, you must access the page by configuring the path for the JSP, because the only way to access the JSP page is to make the configuration parameters work.