spring 3.0使用笔记
Spring 3.0中配置properties文件变得更简单,支持通配符形式
<context:property-placeholder location="classpath:abc.properties" />
<context:property-placeholder location="classpath:abc.properties" ignore-unresolvable="true" />
#springBindEscaped("command.email", true)<#-- until this point, default HTML escaping is used --><#assign htmlEscape = true in spring><#-- next field will use HTML escaping --><@spring.formInput "command.name" /><#assign htmlEscape = false in spring><#-- all future fields will be bound with HTML escaping off -->
public String doCreate(@Valid @ModelAttribute("appForm") CreateAppForm appForm, BindingResult result, ...) { ...}Errors/BindingResult argument declared without preceding model attribute. Check your handler method signature!
<bean id="velocityConfig"value="/WEB-INF/views/" /><property name="velocityProperties"><props><prop key="input.encoding">UTF-8</prop><prop key="output.encoding">UTF-8</prop><!--除默认的FileResourceLoader外再增加自定义的resourceLoader,从classpath中读取(jar,zip)--><prop key="customMacro.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</prop><prop key="customMacro.resource.loader.path">customMacro</prop><prop key="velocimacro.library">xyz/velocity/custom-macro.vm</prop></props></property></bean>