mickeymoon
mickeymoon

Reputation: 4977

How to specify request methods on actions in struts1?

I have some actions in a Struts(1) application. The actions currently are open to both GET/ POST Methods. We want to restrict the visibility of individual Actions to GET/ POST requests. Where do we specify that? Is it done in struts-config.xml

Upvotes: 1

Views: 1246

Answers (1)

Dave Newton
Dave Newton

Reputation: 160191

No, it isn't.

The two easiest options for Struts 1 apps are:

  1. Make a custom request processor that introspects actions (or calls a method, or...) on the request and check if the request type is allowed.
  2. Use a base action class that calls subclass GET- and POST-specific methods based on the request type.

Upvotes: 2

Related Questions