Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Denying direct access to jsp pages

Tags:

java

jsp

struts

I'm using struts 1.3 for my application and all jsp pages are forwarded through controller (action class). But If I access the jsp page directly, I'm able to access it. How do I prevent this?

like image 890
Shwetanka Avatar asked Sep 02 '11 10:09

Shwetanka


2 Answers

put all your jsp-s inside WEB-INF folder (for example in WEB-INF/jsp folder) and dont forget to change your mapping regarding location of jsp-s.

like image 93
Martin Gamulin Avatar answered Oct 28 '22 09:10

Martin Gamulin


Filters are used to bypass or interrupt the requests , so use the filters to restrict the request , if it not contains .do in url. Below is the good tutorial for filters

Filters

like image 28
developer Avatar answered Oct 28 '22 10:10

developer