Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
What is the future of Spring Portlet MVC? Long live PortletMVC4Spring!
Hello Neil,
We are currently in the process of migrating to spring 5 for our Liferay 7.1 portal. We are using the portletmvc4spring Project in order to achieve this. So I have a question regarding the implementation of the portletmvc4spring:
In the PortletRequestMappingHandlerAdapter class in the private invokeHandlerMethod on line 1037 the SessionStatus is set to complete for every RenderRequest and ResourceRequest. I there a specific reason why this was done?
Our issue is that we have the old war packaging and deployment of portlets and are using @SessionAttributes in order to preserve the model after the render phase to have it again in an action phase when a user clicks on a button. But with the SessionStatus set to complete the model is removed from the session and we can't get it after the with @ModelAttribute in any of the phases.The specific use case is that we have a specific non admin role that can see inactive users and enable them. So we load all inactive users and display thenm in a table (default render phase), then the user with the specific role can decide if that user should be activated (action phase activated with button press). With the current implementation the @ModelAttribute is the @ActionMapping is calling the initial @ModelAttribute method since the model has not been stored in the sessionAttributeStore.
Is this a bug on in portletmvc4spring or was this done on purpose?
Regards, Safet Okic
We are currently in the process of migrating to spring 5 for our Liferay 7.1 portal. We are using the portletmvc4spring Project in order to achieve this. So I have a question regarding the implementation of the portletmvc4spring:
In the PortletRequestMappingHandlerAdapter class in the private invokeHandlerMethod on line 1037 the SessionStatus is set to complete for every RenderRequest and ResourceRequest. I there a specific reason why this was done?
Our issue is that we have the old war packaging and deployment of portlets and are using @SessionAttributes in order to preserve the model after the render phase to have it again in an action phase when a user clicks on a button. But with the SessionStatus set to complete the model is removed from the session and we can't get it after the with @ModelAttribute in any of the phases.The specific use case is that we have a specific non admin role that can see inactive users and enable them. So we load all inactive users and display thenm in a table (default render phase), then the user with the specific role can decide if that user should be activated (action phase activated with button press). With the current implementation the @ModelAttribute is the @ActionMapping is calling the initial @ModelAttribute method since the model has not been stored in the sessionAttributeStore.
Is this a bug on in portletmvc4spring or was this done on purpose?
Regards, Safet Okic
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™