I am trying to update from Struts 2.3.32 to Struts 2.5.25.

Before the update, I used to access it in camel case as shown below.
http: // localhost: 8080/xxx/hoge/userLogin

After the update, it became inaccessible and I checked it with config-browser
Action was separated by hyphens.
http: // localhost: 8080/xxx/hoge/user-login

It can be displayed by accessing it separated by hyphens, but
I don't want the URL to change, so I want to solve this.

As one of the methods, if you add the following annotation to the Action class
I found that I could still access it.
@Action (value = "userLogin")

Just without adding such annotations to all Action classes
I want to set it in a configuration file etc. (Because there are quite a lot of classes)

Could anyone please teach me how to do this?

  • Answer # 1

    I found that the following settings can be made in xml,
    Even if you can remove the hyphen delimiter or make it lowercase
    I couldn't make it into a camel case.

    <constant name = "struts.convention.action.name.separator" value = "" />
    <constant name = "struts.convention.action.name.lowercase" value = "false" />

    Because I want to avoid modifying the caller
    It corresponded by annotating the Action class.
    I want to know how it was achieved (TT)