怎么配置spring访问静态html页面
1个回答
2015-09-04
展开全部
Web.xml文件
...
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
...
action-servlet.xml文件
...
<bean id="viewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="requestContextAttribute"value="rc"/>
<property name="viewClass"value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix"value="/WEB-INF/pages/"/>
<property name="suffix"value=".jsp"/>
</bean>
...
...
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
...
action-servlet.xml文件
...
<bean id="viewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="requestContextAttribute"value="rc"/>
<property name="viewClass"value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix"value="/WEB-INF/pages/"/>
<property name="suffix"value=".jsp"/>
</bean>
...
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询