In the default Interceptor Stack, the Prepare Interceptor runs before the Parameters Interceptor. That means that the injection of parameters has not yet occurred when the Prepare Interceptor executes the prepare()
method. You need to move the Parameters Interceptor before the Prepare Interceptor, or to duplicate it, putting one declaration before the Prepare Interceptor.
There is a default Interceptor Stack created with that purpose, paramsPrepareParamsStack
; read more here and here.
Note that this kind of problem is recurrent in Struts2, you need to understand how an Interceptor Stack works and which business every single Interceptor is taking care of.
For example, it happens when using ModelDriven, or when using Wildcard Mapping. And for sure it happens with your custom Interceptor if you put them in the wrong place.