The first time using Struts2.3.20, the foreground page to the background value, how always prompt value is null, find half a day originally was the Struts configuration file action forgot to introduce the defaultstack interceptor, so even if the action of Everything ( Package parameters of getter and setter), or can not achieve the desired results.
Use a custom interceptor to configure the action in the struts profile to also introduce Defaultstack, otherwise the Formbean using Modeldriven will not be able to get the value of the field in the form form.
< Packagename= "Defaults"extends= "Json-default"> <Interceptors> <Interceptorname= "Methodinterceptor"class= "Methodinterceptor"></Interceptor> <Interceptorname= "Logininterceptor"class= "Logininterceptor"></Interceptor> <Interceptor-stackname= "Loginstack"> <Interceptor-refname= "Methodinterceptor"></Interceptor-ref> <Interceptor-refname= "Logininterceptor"></Interceptor-ref> <Interceptor-refname= "Defaultstack"></Interceptor-ref> </Interceptor-stack> </Interceptors> <Global-results> <resultname= "Error"type= "Redirect">/405.jsp</result> <resultname= "Toindex"type= "Redirect">Index</result> <resultname= "Tologin"type= "Redirect">Login</result> </Global-results> </ Package>
Struts2 Default Interceptor Defaultstack