How can I get Request Type(GET or POST) from list of Action names in Struts 2?

70 Views Asked by At

I want to get all POST/GET request types for all of the struts actions present in my application.

I have used struts2-config-browser-plugin and got all action names throughout the application.

Now, I want to get request types of all those action names and consolidated those in a Java collection(list).

Is there any way to find all request types for all struts2 actions without invoking that action.

1

There are 1 best solutions below

0
Roman C On

Is there any way to find all request types for all struts2 actions without invoking that action.

By default Struts2 doesn't map HTTP request types. So you can't get it from the config-browser plugin.

If you want to map it yourself then you should extend the framework with the custom ActionMapper. You can find details how to add a custom action mapped in this answer.