I am using struts 1.2 and using global-forwards to access my jsp files and had also put security constraint in my web.xml file even after putting /pages/* in security constraint i can control direct access to my jsp's through url http://localhost:8080/mywebsite/pages/home.jsp but whenever someone point mouse around my menu item he is able to see url like
http://localhost:8080/mywebsite/home.do which i am displaying in iframe and so nothing can stop direct accessing to home.jsp by hitting above url and able to see home.jsp which i only want to display in iframe of my index.jsp below is the security contraint i am using also i connot use constraint like <url-pattern>*.do</url-pattern>
this will stop even to display home.jsp in an iframe too .
<security-constraint>
<web-resource-collection>
<web-resource-name>JSP Files</web-resource-name>
<description>No direct access to JSP files</description>
<url-pattern>/pages/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<description>No direct browser access to JSP files</description>
<role-name>NobodyHasThisRole</role-name>
</auth-constraint>
</security-constraint>
here is configration in my struts-config.xml
<global-forwards>
<forward name="home" path="/home.do"/>
</global-forwards>
<action-mappings>
<action path="/home" forward="/pages/home.jsp"/>
</action-mappings>