ainideaj 2016-05-20 09:51 采纳率: 0%
浏览 1397

spring 4.2.6 mvc 静态资源访问问题

![新进公司, 尝试自己重新拾起搭一个springmvc框架,可是一个静态资源访问问
题拦住了我两天,求大神帮忙:

图片说明](https://img-ask.csdn.net/upload/201605/20/1463737807_800158.png)
这是使用jar包

图片说明

web.xml 配置:


springmvc

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:config/application*.xml</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
    <servlet-name>springmvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:config/spring-mvc.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>springmvc</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>

spring-mvc.xml配置:

<context:annotation-config />

<mvc:annotation-driven />

<mvc:resources mapping="/views/ui/**" location="/WEB-INF/views/ui/" />
<mvc:resources mapping="/views/new_ui/**" location="/WEB-INF/views/new_ui/" />

<context:component-scan base-package="com.aj.store" />

<!-- 完成请求和注解POJO的映射 -->
<bean
    class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />

<!-- 对模型视图添加前后缀 -->
<bean id="viewResolver"
    class="org.springframework.web.servlet.view.InternalResourceViewResolver"
    p:prefix="/WEB-INF/views/" p:suffix=".html" />

在网上搜了很多解决办法, 什么tomcat default 配置

等都试过。。

  • 写回答

1条回答

  • devmiao 2016-05-21 05:52
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?