What is the config implicit object?
The config object is an object of type javax.servlet.ServletConfig. The ServletConfig for this JSP page. Has a page scope.
The config can be used to retrieve the configuration parameters that are specific to a JSP page. These parameters are set up within the deployment descriptor. To set up the configuration a servlet is configured within web.xml, please see How to config a JSP file in web.xml?.
The config object can be used to retrieve the ServletContext object through its getServletContext() method. Thus the following code retrieves information about the currently executing server, and in my own setup it generates the output.
<%
ServletContext ct = config.getServletContext();
out.print(ct.getServerInfo());
%>
Most Recent jsp Faqs
- How to get the real requested URI from inside the error page?
- Can I define a method in a JSP page?
- What is the difference between request.getParameter() and request.getAttribute()?
- What is difference between page and pageContext in JSP pages?
- How to config a JSP file in web.xml?
- What is the difference between jsp:forward and response.sendRedirect?
- How to retrieve values from HTML form input elements in JSP?
Most Viewed jsp Faqs
- How to config a JSP file in web.xml?
- What is difference between page and pageContext in JSP pages?
- How to disable browser caching for a specific JSP?
- How to retrieve values from HTML form input elements in JSP?
- What is the difference between jsp:forward and response.sendRedirect?
- What is the difference between request.getParameter() and request.getAttribute()?
- How to get the current JSP page name?