Package org.springframework.web.servlet.view

Examples of org.springframework.web.servlet.view.DummyMacroRequestContext


      assertTrue(ex.getMessage().indexOf(FreeMarkerView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE) > -1);
    }
  }

  public void testAllMacros() throws Exception {
    DummyMacroRequestContext rc = new DummyMacroRequestContext(request);
    Map msgMap = new HashMap();
    msgMap.put("hello", "Howdy");
    msgMap.put("world", "Mundo");
    rc.setMessageMap(msgMap);
    Map themeMsgMap = new HashMap();
    themeMsgMap.put("hello", "Howdy!");
    themeMsgMap.put("world", "Mundo!");
    rc.setThemeMessageMap(themeMsgMap);
    rc.setContextPath("/springtest");

    TestBean tb = new TestBean("Darren", 99);
    tb.setSpouse(new TestBean("Fred"));
    request.setAttribute("command", tb);
View Full Code Here


      assertTrue(ex.getMessage().indexOf(VelocityView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE) > -1);
    }
  }

  public void testAllMacros() throws Exception {
    DummyMacroRequestContext rc = new DummyMacroRequestContext(request);
    Map msgMap = new HashMap();
    msgMap.put("hello", "Howdy");
    msgMap.put("world", "Mundo");
    rc.setMessageMap(msgMap);
    Map themeMsgMap = new HashMap();
    themeMsgMap.put("hello", "Howdy!");
    themeMsgMap.put("world", "Mundo!");
    rc.setThemeMessageMap(themeMsgMap);
    rc.setContextPath("/springtest");

    TestBean tb = new TestBean("Darren", 99);
    request.setAttribute("command", tb);

    HashMap names = new HashMap();
View Full Code Here

    assertNotNull(macro);

    FileSystemResource resource = new FileSystemResource(System.getProperty("java.io.tmpdir") + "/tmp.ftl");
    FileCopyUtils.copy("<#import \"spring.ftl\" as spring />\n" + macro, new FileWriter(resource.getPath()));

    DummyMacroRequestContext rc = new DummyMacroRequestContext(request);
    Map<String, String> msgMap = new HashMap<String, String>();
    msgMap.put("hello", "Howdy");
    msgMap.put("world", "Mundo");
    rc.setMessageMap(msgMap);
    Map<String, String> themeMsgMap = new HashMap<String, String>();
    themeMsgMap.put("hello", "Howdy!");
    themeMsgMap.put("world", "Mundo!");
    rc.setThemeMessageMap(themeMsgMap);
    rc.setContextPath("/springtest");

    TestBean darren = new TestBean("Darren", 99);
    TestBean fred = new TestBean("Fred");
    fred.setJedi(true);
    darren.setSpouse(fred);
View Full Code Here

      assertTrue(ex.getMessage().contains(VelocityView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE));
    }
  }

  public void testAllMacros() throws Exception {
    DummyMacroRequestContext rc = new DummyMacroRequestContext(request);
    Map<String, String> msgMap = new HashMap<String, String>();
    msgMap.put("hello", "Howdy");
    msgMap.put("world", "Mundo");
    rc.setMessageMap(msgMap);
    Map<String, String> themeMsgMap = new HashMap<String, String>();
    themeMsgMap.put("hello", "Howdy!");
    themeMsgMap.put("world", "Mundo!");
    rc.setThemeMessageMap(themeMsgMap);
    rc.setContextPath("/springtest");

    TestBean tb = new TestBean("Darren", 99);
    tb.setJedi(true);
    tb.setStringArray(new String[] {"John", "Fred"});
    request.setAttribute("command", tb);
View Full Code Here

  }

  // SPR-5172

  public void testIdContainsBraces() throws Exception {
    DummyMacroRequestContext rc = new DummyMacroRequestContext(request);
    Map<String, String> msgMap = new HashMap<String, String>();
    msgMap.put("hello", "Howdy");
    msgMap.put("world", "Mundo");
    rc.setMessageMap(msgMap);
    Map<String, String> themeMsgMap = new HashMap<String, String>();
    themeMsgMap.put("hello", "Howdy!");
    themeMsgMap.put("world", "Mundo!");
    rc.setThemeMessageMap(themeMsgMap);
    rc.setContextPath("/springtest");

    TestBean darren = new TestBean("Darren", 99);
    TestBean fred = new TestBean("Fred");
    fred.setJedi(true);
    darren.setSpouse(fred);
View Full Code Here

TOP

Related Classes of org.springframework.web.servlet.view.DummyMacroRequestContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.