Announcement Announcement Module
No announcement yet.
@SessionAttributes doesn't get removed in Spring Portlet MVC Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • @SessionAttributes doesn't get removed in Spring Portlet MVC

    I have a simple Portlet that I expect to take some user input, do some stuff and show a success message. The code goes like this:

    @Controller(value = "myController")
    @RequestMapping(value = "VIEW")
    public class MyController {
        public Map<String, String> getSomeList() {
            return theList;
        public CambioPlanCommand getCommandObject(PortletSession session,
                Principal principal) throws SeguridadMiClaroException {
            MyCommand command = new MyCommand();
            return command;
        public String showView() {
            return "myView";
        @ActionMapping(params = "action=stuff")
        public void doStuff(
                @ModelAttribute(value = "myCommand") MyCommand datosFormulario,
                BindingResult bindingResult, SessionStatus status,
                PortletSession session, Principal principal, ModelMap modelMap,
                PortletRequest request) {
                modelMap.put("theMessage", "Stuff is done");
    The first time I execute the Portlet everything goes fine: The command object gets populated, the message is put in model and my JSP shows it in screen. Then I go to another page to play with some other portlets; and when I return to my original Portlet I expect the following:

    - To get an empty instance of MyCommand
    - To see no Message in Screen

    But I find the opossite, and I still see the message configured in the previous request. I'm very confused about this, since the Message was not configured as a SessionAttribute (only the command) and I called SessionStatus.setComplete() so if everything was stored in Session it should already be removed.

    Any ideas?
    Last edited by cptan_alatriste; Oct 29th, 2012, 09:41 AM. Reason: Format improvement

  • #2
    Seems realted to this Jira Issue and this Thread. Any news if this get fixed?