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