Changing ParameterAware to HttpParametersAware

前端 未结 1 1093
栀梦
栀梦 2021-01-23 10:42

I\'m upgrading my project from struts 2.3.1 to 2.5.12 Since ParametersAware is deprecated in 2.5.12, I want to change ParametersAware to HttpPara

1条回答
  •  一个人的身影
    2021-01-23 11:21

    Change Map to HttpParameters. The later class implements a Map, so you can use this to get/put parameters to the map.

    The most interesting is a Parameter interface that has implementations Parameter.Empty, Parameter.File, Parameter.Request. The last one is used to retrieve request parameters.

    This answer How could I get a parameter in JSP will throw a light on a typical usage of request parameters if you want to manipulate parameters manually.

    Another approach (which is not recommended) is to get request parameters from the request itself. See Interceptors use in login in Struts 2.0.

    0 讨论(0)
提交回复
热议问题