视图,简单说就是JSP文件!
视图解析器的作用:通过视图名称,找到视图!
视图解析器有很多,常用的只有以下这种
在spring文件配置文件中加
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value= ""/>
<property name="suffix" value= ".jsp"/>
</bean>
redirect跳转的方式,视图解析器不起作用。 prefix前缀的意思,suffix后缀的意思
网站内跳转一般使用容器内跳转
网站外跳转才用到redirect方式容器外跳转