Using struts 2 framework. I'm facing a problem that user can access javascript file directly with URL
www.testAccess.com/scripts/somescript.js
I am config web.xml with this code. but not working
<security-constraint>
<web-resource-collection>
<web-resource-name>Deny Direct Access</web-resource-name>
<description></description>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.js</url-pattern> <<< here
</web-resource-collection>
<auth-constraint>
<role-name>Denied</role-name>
</auth-constraint>
</security-constraint>
<security-role>
<role-name>Denied</role-name>
</security-role>
Thanks for your help.