标签:web input 表单元素 show res resource frame 转发 abstract
SpringMVC中的所有handler方法都需要解析某一个逻辑视图名称
InternalResourceViewResolver
jsp返回ResourceBundleViewResolver
资源绑定VelocityViewResolver / FreeMarkerViewResolver
其他语言的视图解析器BeanNameViewResolver
自定义视图解析器InternalResourceViewResolver
URLBasedViewResolver
的子类HttpServletRequest
中,然后转发到相应的页面视图 <bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/" />
<property name="suffix" value=".jsp" />
</bean>
Srping提供了一组全面的用于处理表单元素进行数据绑定的标签
实现页面与数据双向绑定
<%@ taglib prefix="form" url="http://www.springframework.org/tags/form" %>
<form:form commandName="">
<form:input path="name" />
<form:password path="code" value="123" showPassword="true"/>
<form:radiobutton path="area" value="large" />
<form:radiobutton path="area" value="small" />
<form:radiobuttons path="size" items="${sizes }"/>
<form:radiobuttons path="province" items="${provinces }" itemLabel="id" itemValue="name"/>
绑定数据:
<form:select path="province">
<form:option value="0" label="请选择..." />
<form:options items="${provinces }" itemLabel="name" itemValue="id" />
</form:select>
<form:hidden path="id" />
<bean class=“org.springframework.web.servlet.view.BeanNameViewResolver”/>
<bean id=“userExcel” class=“com.web.UserListExcelView”/>
<bean id=“userPdf” class=“com.web.UserListPdfView”/>
标签:web input 表单元素 show res resource frame 转发 abstract
原文地址:https://www.cnblogs.com/occlive/p/13574952.html