I am practising JSP. I have a a problem with JSP authentication with spring source tool suite 2.5.
I have few JSPs in a folder, while accessing the application in tomcat it is not asking for any credentials. It simply displays the jsp which should not.
Which URL are you accessing that you think should be protected?
maheedar sand
Greenhorn
Joined: Feb 26, 2008
Posts: 14
posted
0
Hi,
Thank you very much for the reply
Actually I created a web project named test. Under test I created a folder under root named admin. under this folder there are some jsps that need to be protected. So, I defined the security mechanism as per described in the web.xml file. when I execute the application in local tomcat it is not asking for any credentials.
the url I tried to access is: http://localhost:8080/test/admin/enter.jsp.
Also I checked the book examples. They are working fine. I'm not finding up the mistake.
Please, help the needful.
Thanks and Regards,
sathish kumar.g.
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2329
posted
0
Remove the web app name from the url-pattern: <url-pattern>/admin/*</url-pattern>
maheedar sand
Greenhorn
Joined: Feb 26, 2008
Posts: 14
posted
0
Hi,
Thank you very much for the help Its working buddy. But what is the difference. If we give it is only context name. Please explain if possible...
Thanks and Regards,
sathish kumar.g.
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2329
posted
0
The difference is between a correct path and an incorrect path. If <taglib-location> in your web.xml doesn't include the web app name, why would <url-pattern>? All such paths are relative to the web app root.