How to read from configuration file in jsp

The method of reading from the configuration file in sp:

 

 

1. Get it from the configuration file in java

2. Put it in the session

3. Session acquisition in jsp

4, js is obtained from jsp, applied to scripts or jsp is obtained with placeholders

 

 

 

       String weixinOrderDetailUrl = ConfigInfo.getPropertiesValue("weixinOrderDetailUrl");

       this.setSession("weixinOrderDetailUrl", weixinOrderDetailUrl);

 

 

 

 

<%

String obj=(String)request.getSession().getAttribute("ACEGI_SECURITY_LAST_USERNAME");

String weixinOrderDetailUrl=(String)request.getSession().getAttribute("weixinOrderDetailUrl");

    String agentId="";

    if(obj!=null){

        agentId="1"+obj;

    }

    request.setAttribute("agentId", agentId);

    request.setAttribute("weixinOrderDetailUrl", weixinOrderDetailUrl);

%>

var flag=<%=request.getParameter("flag")%>;

var agentId = "${agentId}";

var weixinOrderDetailUrl = "${weixinOrderDetailUrl}";

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326184891&siteId=291194637