码迷,mamicode.com
首页 > 其他好文 > 详细

常量设置

时间:2015-03-10 13:55:55      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:

package com.longtime.ajy.student.config;

 

import org.springframework.context.annotation.Lazy;

 

import org.springframework.stereotype.Component;

import org.springframework.beans.factory.annotation.Value;

 

@Component

@Lazy(false)

public class Constant {

 

    public static String IMG_SERVER_DOWNLOAD;

    public static String IMG_SERVER_UPLOAD;

  

    

    

    @Value("${com.longtime.imgserver.download}")

    public void setImgServerDownload(String imgServerDownload){

        IMG_SERVER_DOWNLOAD = imgServerDownload;

    }

    

    

    @Value("${com.longtime.imgserver.upload}")

    public void setImgServerUpLoad(String imgServerUpload){

        IMG_SERVER_UPLOAD = imgServerUpload;

    }

    

}

 

 

 

页面调用常量:

<%@page import="com.longtime.ajy.student.config.Constant”%>

<%=Constant.IMG_SERVER_DOWNLOAD%>

常量设置

标签:

原文地址:http://www.cnblogs.com/spiritualWindows/p/4325749.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!