How can we avoid direct access of JSP pages from client browser?

How can we avoid direct access of JSP pages from client browser?

We know that anything inside WEB-INF directory canít be accessed directly in web application, so we can place our JSP pages in WEB-INF directory to avoid direct access to JSP page from client browser. But in this case, we will have to configure it in deployment descriptor just like Servlets.

Sample configuration is given below code snippet of web.xml file.

<servlet>

<servlet-name>jspTest</servlet-name>

<jsp-file>/WEB-INF/test.jsp</jsp-file>

<init-param>

<param-name>jsptest</param-name>

<param-value>jspTest Value</param-value>

</init-param>

</servlet>

<servlet-mapping>

<servlet-name>jspTest</servlet-name>

<url-pattern>/jspTest.do</url-pattern>

</servlet-mapping>

Read More →
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!