Configuring JSP File

Prev Tutorial Next Tutorial

Configuring JSP File

Configuring a JSP into a web.xml file is optional because JSP is a public file to the web application.

A JSP called a public file and servlet is called a private file of the web application. Because JSP files stored in root directory of the web application and Servlet class file stored in sub directory of the web application. Because JSP is the public file, we can directly send a request from a browser by using its file name.

If we want ot configure a JSP in web.xml file the the xml elements are same as Servlet-configuration. We need to replace <servlet-class> element with <jsp-file>



Note: If we configure a jsp in web.xml then we can send the request to the jsp either by using jsp filename or by using its url-pattern.



Prev Tutorial Next Tutorial

Facebook Likes