springmvc映射html文件以及解决乱码问题

时间:2022-02-16 21:40:07

<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>

<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/html/" />
<property name="suffix" value=".html"></property>
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
</bean>

<filter-mapping>
<filter-name>c你自己的过滤器名字</filter-name>
<url-pattern>*.html</url-pattern>
</filter-mapping>