0

我正在尝试使用 spring mvc 映射我的静态资源,但它不起作用

springServletContext.xml

    <beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
       http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">

    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/resources/pages/"/>
    <property name="suffix" value=".jsp"/>
</bean> 

<mvc:resources mapping="/static/**" location="/WEB-INF/resources/static/"  />

</beans>

springContext.xml

  <beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:p="http://www.springframework.org/schema/p"
   xmlns:aop="http://www.springframework.org/schema/aop"
   xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:context="http://www.springframework.org/schema/context"
   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<bean id="propertyConfigurer"
      class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
      p:location="/WEB-INF/mysqlConfig.properties" />



    <context:annotation-config />
<context:component-scan base-package="com.bakaenterprise">

</context:component-scan>

 <bean name="handlerMapping"
          class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>
    <bean name="handlerAdapter"


class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/>   

    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">

        <property name="driverClassName" value="${jdbc.driverClassName}" />
        <property name="url" value="${jdbc.url}" />
        <property name="username" value="${jdbc.username}" />
        <property name="password" value="${jdbc.password}" />
        <property name="initialSize" value="15" />
        <property name="maxActive" value="20" />
        <property name="maxWait" value="5000" />
        <property name="validationQuery" value="SELECT 1 FROM file_upload" />

        <property name="testOnBorrow" value="true" />
        <property name="testWhileIdle" value="true" />

    </bean>
   <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

<tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
        <tx:method name="get*" read-only="true" propagation="REQUIRED"/>
        <tx:method name="*" propagation="REQUIRED"/>
    </tx:attributes>
</tx:advice>

    <tx:annotation-driven transaction-manager="transactionManager"/>

    <!-- Hibernate Configuration -->
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
        p:dataSource-ref="dataSource" p:packagesToScan="com.bakaenterprise.beans">

        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.MySQLDialect
                </prop>

                <prop key="hibernate.show_sql">
                    true
                </prop>
                   <prop key="hibernate.format_sql">
                    true
                </prop>
                <prop key="hibernate.generate_statistics">
                    true
                </prop>
            </props>
        </property>
    </bean>

    </beans>

web.xml

  <?xml version="1.0" encoding="UTF-8"?>

    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
        <!--        <servlet>
        <servlet-name>jersey-serlvet</servlet-name>
        <servlet-class>
                     com.sun.jersey.spi.container.servlet.ServletContainer
                </servlet-class>
        <init-param>
             <param-name>com.sun.jersey.config.property.packages</param-name>
             <param-value>com.bakaenterprise.server</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>-->
    <servlet>
        <servlet-name>spring-mvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
            /WEB-INF/springServletContext.xml
        </param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
        <servlet-mapping>
        <servlet-name>spring-mvc</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <jsp-config>
        <taglib>
            <taglib-uri>/jstl/core_rt</taglib-uri>
            <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>/jstl/xml_rt</taglib-uri>
            <taglib-location>/WEB-INF/tld/x_rt.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>/jstl/fn_rt</taglib-uri>
            <taglib-location>/WEB-INF/tld/fn.tld</taglib-location>
        </taglib>
        <taglib>
            <taglib-uri>/jstl/fmt_rt</taglib-uri>
            <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
        </taglib>
    </jsp-config>


    <filter>
        <filter-name>performance</filter-name>
        <filter-class>com.bakaenterprise.util.PerformanceLog</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>performance</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/springContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>
        org.springframework.web.context.ContextLoaderListener
       </listener-class>
    </listener>
    </web-app>

此外还有一些重复的日志记录似乎 springContext.xml 中存在一些问题

很少的日志

      Using CATALINA_BASE:   "C:\Users\haier\AppData\Roaming\NetBeans\7.2.1\apache-tomcat-7.0.27.0_base"
    Using CATALINA_HOME:   "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27"
    Using CATALINA_TMPDIR: "C:\Users\haier\AppData\Roaming\NetBeans\7.2.1\apache-tomcat-7.0.27.0_base\temp"
    Using JRE_HOME:        "C:\Program Files\Java\jdk1.7.0_13"
    Using CLASSPATH:       "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin\tomcat-juli.jar"
    Listening for transport dt_shmem at address: tomcat_shared_memory_id
    Sep 19, 2013 6:24:00 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_13\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Java\jdk1.7.0_13\bin;E:\maven\bin;;.
    Sep 19, 2013 6:24:00 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8084"]
    Sep 19, 2013 6:24:00 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
    Sep 19, 2013 6:24:00 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 681 ms
    Sep 19, 2013 6:24:00 PM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    Sep 19, 2013 6:24:00 PM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
    Sep 19, 2013 6:24:00 PM org.apache.catalina.startup.HostConfig deployDescriptor
    INFO: Deploying configuration descriptor C:\Users\haier\AppData\Roaming\NetBeans\7.2.1\apache-tomcat-7.0.27.0_base\conf\Catalina\localhost\app.xml
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined
    Sep 19, 2013 6:24:01 PM org.apache.catalina.startup.TaglibUriRule body
    INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined
    log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
    log4j:WARN Please initialize the log4j system properly.
    6260 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Registered injected element on class [com.bakaenterprise.bl.impl.UserServiceImpl]: AutowiredFieldElement for com.bakaenterprise.dal.ProfileDao com.bakaenterprise.bl.impl.UserServiceImpl.profileDao
    6261 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'userServiceImpl' to allow for resolving potential circular references
    6269 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Processing injected method of bean 'userServiceImpl': AutowiredFieldElement for com.bakaenterprise.dal.ProfileDao com.bakaenterprise.bl.impl.UserServiceImpl.profileDao
    6269 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'profileDaoImpl'
org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'profileMessageDaoImpl'
    6594 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'profileMessageDaoImpl'
    6595 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Registered injected element on class [com.bakaenterprise.dal.impl.ProfileMessageDaoImpl]: AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6595 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'profileMessageDaoImpl' to allow for resolving potential circular references
    6625 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Processing injected method of bean 'profileMessageDaoImpl': AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6625 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'sessionManager'
    6625 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor  - Autowiring by type from bean name 'profileMessageDaoImpl' to bean named 'sessionManager'
    6625 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
    6625 [pool-2-thread-1] DEBUG org.springframework.transaction.annotation.AnnotationTransactionAttributeSource  - Adding transactional method 'save' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''
    6626 [pool-2-thread-1] DEBUG org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator  - Creating implicit proxy for bean 'profileMessageDaoImpl' with 0 common interceptors and 1 specific interceptors
    6626 [pool-2-thread-1] DEBUG org.springframework.aop.framework.JdkDynamicAopProxy  - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.bakaenterprise.dal.impl.ProfileMessageDaoImpl@abb0af]
    6643 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'profileMessageDaoImpl'
    6643 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'searchDaoImpl'
    6643 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'searchDaoImpl'
    6644 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Registered injected element on class [com.bakaenterprise.dal.impl.SearchDaoImpl]: AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6644 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'searchDaoImpl' to allow for resolving potential circular references
    6662 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Processing injected method of bean 'searchDaoImpl': AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6663 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'sessionManager'
    6663 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor  - Autowiring by type from bean name 'searchDaoImpl' to bean named 'sessionManager'
    6663 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
    6663 [pool-2-thread-1] DEBUG org.springframework.transaction.annotation.AnnotationTransactionAttributeSource  - Adding transactional method 'save' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''
    6663 [pool-2-thread-1] DEBUG org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator  - Creating implicit proxy for bean 'searchDaoImpl' with 0 common interceptors and 1 specific interceptors
    6663 [pool-2-thread-1] DEBUG org.springframework.aop.framework.JdkDynamicAopProxy  - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.bakaenterprise.dal.impl.SearchDaoImpl@8f8dd9]
    6669 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'searchDaoImpl'
    6670 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'sessionManager'
    6670 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'uploadDaoImpl'
    6670 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'uploadDaoImpl'
    6674 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Registered injected element on class [com.bakaenterprise.dal.impl.UploadDaoImpl]: AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6674 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'uploadDaoImpl' to allow for resolving potential circular references
    6693 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Processing injected method of bean 'uploadDaoImpl': AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6693 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'sessionManager'
    6693 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor  - Autowiring by type from bean name 'uploadDaoImpl' to bean named 'sessionManager'
    6693 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
    6693 [pool-2-thread-1] DEBUG org.springframework.transaction.annotation.AnnotationTransactionAttributeSource  - Adding transactional method 'save' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''
    6693 [pool-2-thread-1] DEBUG org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator  - Creating implicit proxy for bean 'uploadDaoImpl' with 0 common interceptors and 1 specific interceptors
    6693 [pool-2-thread-1] DEBUG org.springframework.aop.framework.JdkDynamicAopProxy  - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.bakaenterprise.dal.impl.UploadDaoImpl@fea922]
    6697 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'uploadDaoImpl'
    6697 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'userDaoImpl'
    6697 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'userDaoImpl'
    6699 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Registered injected element on class [com.bakaenterprise.dal.impl.UserDaoImpl]: AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6699 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Registered injected element on class [com.bakaenterprise.dal.impl.UserDaoImpl]: AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6699 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'userDaoImpl' to allow for resolving potential circular references
    6699 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'userDaoImpl' to allow for resolving potential circular references
    6717 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Processing injected method of bean 'userDaoImpl': AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6717 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.InjectionMetadata  - Processing injected method of bean 'userDaoImpl': AutowiredFieldElement for private com.bakaenterprise.dal.impl.SessionManager com.bakaenterprise.core.base.HibernateDaoSupport.sessionManager
    6717 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'sessionManager'
    6717 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'sessionManager'
    6717 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor  - Autowiring by type from bean name 'userDaoImpl' to bean named 'sessionManager'
    6717 [pool-2-thread-1] DEBUG org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor  - Autowiring by type from bean name 'userDaoImpl' to bean named 'sessionManager'
    6734 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
    6734 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
    6734 [pool-2-thread-1] DEBUG org.springframework.transaction.annotation.AnnotationTransactionAttributeSource  - Adding transactional method 'save' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''
    6734 [pool-2-thread-1] DEBUG org.springframework.transaction.annotation.AnnotationTransactionAttributeSource  - Adding transactional method 'save' with attribute: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''
    6734 [pool-2-thread-1] DEBUG org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator  - Creating implicit proxy for bean 'userDaoImpl' with 0 common interceptors and 1 specific interceptors
    6734 [pool-2-thread-1] DEBUG org.springframework.aop.framework.autoproxy.InfrastructureAdvisorAutoProxyCreator  - Creating implicit proxy for bean 'userDaoImpl' with 0 common interceptors and 1 specific interceptors
    6734 [pool-2-thread-1] DEBUG org.springframework.aop.framework.JdkDynamicAopProxy  - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.bakaenterprise.dal.impl.UserDaoImpl@1d1bd7f]
    6734 [pool-2-thread-1] DEBUG org.springframework.aop.framework.JdkDynamicAopProxy  - Creating JDK dynamic proxy: target source is SingletonTargetSource for target object [com.bakaenterprise.dal.impl.UserDaoImpl@1d1bd7f]
    6740 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'userDaoImpl'
    6740 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Finished creating instance of bean 'userDaoImpl'
    6740 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'jobsParserImpl'
    6740 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating shared instance of singleton bean 'jobsParserImpl'
    6740 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'jobsParserImpl'
    6740 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Creating instance of bean 'jobsParserImpl'
    6740 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'jobsParserImpl' to allow for resolving potential circular references
    6740 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Eagerly caching bean 'jobsParserImpl' to allow for resolving potential circular references
    6749 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
    6749 [pool-2-thread-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory  - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
    6750 [pool-2-thread-1] DEBUG 

任何帮助将不胜感激。

谢谢,

4

1 回答 1

0

请注意,您的DispatcherServlet

<servlet>
    <servlet-name>spring-mvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        /WEB-INF/springServletContext.xml
    </param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>spring-mvc</servlet-name>
    <url-pattern>/services/*</url-pattern>
</servlet-mapping>

映射到/services/*。这意味着您的<mvc:resources>映射 URL 应该是相对的。

<script src="${contextPath}/services/static/js/custom.js" />
于 2013-09-19T13:48:22.753 回答