get absolute URL with EL

后端 未结 2 587
执笔经年
执笔经年 2021-01-02 06:33

How can I build up an absolute URL using no scriptlets (only EL) to the current server, using the current protocol, port, application etc?

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-02 07:28

    You can get the base URL up to with the context root with help of JSTL as follows:

    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
    ...
    
    ...
    
    
    link
    

提交回复
热议问题