Is there a configurable way in Struts 1.x so my action classses are only executed on HTTP 'POST' only.
I understand I can use request.getMethod()
within my action class and then do certain 'stuff' based on that.
Regards, Jonathan
You can use your web.xml
to define access permissions. This constraint prevents GET requests:
<security-constraint>
<web-resource-collection>
<web-resource-name>struts action servlet</web-resource-name>
<url-pattern>*.do</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<!-- no one! -->
</auth-constraint>
</security-constraint>