首先确定El表达式的查找范围:

依次从Page、Request、Session、Application 中的 attribute属性中查找.

 

<%
                        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
                                + "/";
                        //设置为app路径
                        basePath += "venusApp/";%>

对于在jsp中自定义java变量El表达式如何获得?

request.setAttribute("basePath", basePath);

根据上述查找范围直接定义在attribute即可通过EL表达式  ${basePath}获得;

相关文章:

  • 2021-11-15
  • 2021-11-12
  • 2021-10-08
  • 2022-02-09
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-22
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
相关资源
相似解决方案