zoukankan      html  css  js  c++  java
  • 常量设置

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

  • 相关阅读:
    spring reference
    Connector for Python
    LDAP
    REST
    java利用泛型实现不同类型可变参数
    java细节知识
    事务隔离的级别
    servlet cdi注入
    session and cookie简析
    CORS’s source, principle and implementation
  • 原文地址:https://www.cnblogs.com/spiritualWindows/p/4325749.html
Copyright © 2011-2022 走看看