Uploaded image for project: 'Blossom'
  1. Blossom
  2. BLOSSOM-40

Model not emptied after rendering of paragraph completes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.2.2
    • 1.2.1
    • None
    • None
    • Magnolia 4.4.1, Blossom 1.2.1, Tomcat-6, Java 6

      It seems as if the ModelMap is not cleared between internal paragraph renders and values from the previous paragraphs ModelMap are accessible in subsequent paragraphs views if not overwritten.

      Having two Blossom Controllers, the first returns a model, the second one returns no model for the view.

      @Paragraph(name = "test1", value = "Test1")
      @Controller
      public class TestController1 {

      @RequestMapping("/test1.do")
      public ModelAndView handleRequest(Content content) throws Exception

      { HashMap x = new HashMap<String, String>(); x.put("text", "test1"); return new ModelAndView("/test1", x); }

      @TabFactory("Content")
      public void addTab(TabBuilder tab)

      {tab.addHidden("bogus", "bogus");}

      }

      and

      @Paragraph(name = "test2", value = "Test2")
      @Controller
      public class TestController2 {
      @RequestMapping("/test2.do")
      public ModelAndView handleRequest(Content content) throws Exception

      { return new ModelAndView("/test2"); }

      @TabFactory("Content")
      public void addTab(TabBuilder tab)

      { tab.addHidden("bogus", "bogus"); }

      }

      Both views contain just
      ${text}

      TestController1 runs fine. If TestController2 is run for a subsequent paragraph, the view will output "test1" as well, although no Model was returned. Returning an empty Model doesn't fix this either. TestController2 needs to return a ModelMap with the attribute "text" explicitly set to null in order to archieve the desired result.

        Acceptance criteria

              tmattsson Tobias Mattsson
              philipp.gaschuetz Philipp Gaschütz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD