Message Boards

SessionAttributes doesn't persist in model in action phase

Ovidiu David Dan, modified 3 Years ago.

SessionAttributes doesn't persist in model in action phase

New Member Posts: 15 Join Date: 1/23/17 Recent Posts

Hello,

We are migrating portlets from Liferay 6.2 to Liferay 7.3 but it seems the model from rendermapping phase it isn't the same than in actionmapping phase 

My code is:

@Controller
@SessionAttributes(types = { String.class, Locale.class, List.class, HashMap.class })
@RequestMapping("VIEW")
public class ControladorPortlet {

    @RenderMapping
    public String entrada(RenderRequest request,Map<String, Object> modeloPagina, RenderResponse resp) {
                modeloPagina.put("OPERATION", "1");
                //.............................................
                return "VISTA";

    }

    @ActionMapping(params = "accion=continuar")
    public void nuevaPagina(PortletRequest portletReq, Map<String, Object> modeloPagina,ActionRequest request,
            ActionResponse response) {        
          
        //Here modeloPagina is empty  and we expect to have the field OPERATION
            
    //        
}

In liferay 6.2 we had spring 4.0 and now we have spring 5.0

Do you see anything that I may have missed? Any help would be much appreciated.

 

SOLVED: It is a bug in portletmvc4spring, 7.2.1 version. https://issues.liferay.com/browse/MVCS-37