Hello Devs,
In this tutorial, we are going to learn about JSP Config implicit object. In JSP, config is an implicit object of type ServletConfig.
The config object is created by the web container for each jsp page
web.xml
<web-app>
<servlet>
<servlet-name>StudentsTutorial</servlet-name>
<jsp-file>/index.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>StudentsTutorial</servlet-name>
<url-pattern>/index</url-pattern>
</servlet-mapping>
</web-app>
index.jsp
<!DOCTYPE html>
<html>
<head>
<title> JSP Config</title>
</head>
<body>
<%
String name=config.getServletName();
out.print("Name of Servlet is: "+name);
%>
</body>
</html>
I hope this example helps you.