Spring@Value注解失效問題解決方案-創(chuàng)新互聯(lián)

項目使用的是SSM體系,spring的配置如下,配置沒問題,因為我發(fā)現(xiàn)其他文件中的@Value可以使用,只有一處@Value失效了。

成都創(chuàng)新互聯(lián)自2013年創(chuàng)立以來,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目網(wǎng)站設(shè)計、做網(wǎng)站網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元道外做網(wǎng)站,已為上家服務(wù),為道外各地企業(yè)和個人服務(wù),聯(lián)系電話:18982081108

spring-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:websocket="http://www.springframework.org/schema/websocket"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
            http://www.springframework.org/schema/mvc
            http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context-4.0.xsd
            http://www.springframework.org/schema/aop
            http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
            http://www.springframework.org/schema/tx
            http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
            http://www.springframework.org/schema/websocket
            http://www.springframework.org/schema/websocket/spring-websocket.xsd">

  <context:property-placeholder ignore-unresolvable="true" location="classpath*:config.properties" />


  <!-- 使用Annotation自動注冊Bean,Controllerller -->
  <context:component-scan base-package="com.magicmed.ecg" use-default-filters="false"> <!--base-package 如果多個,用“,”分隔-->
    <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
  </context:component-scan>

  <!-- 自定義注解實現(xiàn)日志記錄 -->
  <aop:aspectj-autoproxy />

  <mvc:annotation-driven />


  <import resource="classpath:mybatis-spring.xml" />
  <import resource="classpath:mail-spring.xml" />
  <import resource="classpath:rabbitmq-spring.xml" />

</beans>

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)建站muchs.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

新聞標(biāo)題:Spring@Value注解失效問題解決方案-創(chuàng)新互聯(lián)
當(dāng)前鏈接:http://muchs.cn/article44/cdsjhe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、搜索引擎優(yōu)化、小程序開發(fā)、網(wǎng)站建設(shè)標(biāo)簽優(yōu)化、網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都做網(wǎng)站