1 16 17 package org.springframework.web.servlet.view; 18 19 import java.util.Map ; 20 21 import org.springframework.beans.TestBean; 22 23 29 public class DummyMacroRequestContext { 30 Map msgMap; 31 String contextPath; 32 TestBean command; 33 34 public String getMessage(String code) { 35 return (String ) msgMap.get(code); 36 } 37 public String getMessage(String code, String defaultMsg) { 38 String msg = (String ) msgMap.get(code); 39 return (msg == null) ? defaultMsg : msg; 40 } 41 public DummyBindStatus getBindStatus(String path) throws IllegalStateException { 42 return new DummyBindStatus(); 43 } 44 public DummyBindStatus getBindStatus(String path, boolean htmlEscape) throws IllegalStateException { 45 return new DummyBindStatus(); 46 } 47 48 public String getContextPath() { 49 return contextPath; 50 } 51 public void setContextPath(String contextPath) { 52 this.contextPath = contextPath; 53 } 54 public void setMsgMap(Map msgMap) { 55 this.msgMap = msgMap; 56 } 57 public TestBean getCommand() { 58 return command; 59 } 60 public void setCommand(TestBean command) { 61 this.command = command; 62 } 63 64 public class DummyBindStatus { 65 public String getExpression() { 66 return "name"; 67 } 68 public String getValue() { 69 return "Darren"; 70 } 71 } 72 } 73 74 | Popular Tags |