常量设置

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%>

posted @ 2015-03-10 13:17  明天-星空  阅读(218)  评论(0编辑  收藏  举报