Spring MVC的标签在Velocity中的使用
2007-06-18 22:23
357 查看
以下代码演示如何使用#springBind宏
#springBind("command.phone) -----绑定status变量
phone:<input type="Text" name="${status.expression}" 表单域名称
value="${status.value}">
如果错误信息中含有(< > &)等字符,我们需要这样使用#springBindExcaped("common.phone",true)
当为false时候,#springBindExcaped等同于#springBind
为了在velocity中使用宏,我们需要在配置文件中为VelocityViewResolver配置如下属性
<property name="exposeSpringMacroHelpers">
<value>true</value>
</property>
#springBind("command.phone) -----绑定status变量
phone:<input type="Text" name="${status.expression}" 表单域名称
value="${status.value}">
如果错误信息中含有(< > &)等字符,我们需要这样使用#springBindExcaped("common.phone",true)
当为false时候,#springBindExcaped等同于#springBind
为了在velocity中使用宏,我们需要在配置文件中为VelocityViewResolver配置如下属性
<property name="exposeSpringMacroHelpers">
<value>true</value>
</property>
相关文章推荐
- 关于Spring MVC中的表单标签库的使用
- [Spring MVC]学习笔记--form表单标签的使用
- 使用Spring MVC表单标签
- Spring MVC中使用errors标签
- Spring mvc 实例--使用velocity视图,解决中文乱码问题
- 关于Spring MVC中的表单标签库的使用
- 【SpringMVC】<context:include-filter>和<context:exclude-filter>使用时要注意的地方 在Spring MVC中的配置中一般会遇到这两个标签,作
- spring mvc使用@InitBinder 标签对表单数据绑定
- 在Spring MVC中使用Velocity
- spring mvc使用@InitBinder标签对表单数据绑定的方法
- 使用Spring MVC表单标签
- JSTL中<c:import />标签的简单使用-以和Spring MVC搭配为例
- Spring MVC框架select,option和options标签的使用
- Spring MVC框架errors标签的使用
- spring mvc使用@InitBinder 标签对表单数据绑定
- spring mvc使用@InitBinder 标签对表单数据绑定
- Spring MVC表单标签的使用
- 使用Spring MVC表单标签一
- spring mvc使用Maven配置Velocity
- spring mvc使用@InitBinder 标签对表单数据绑定