Get current filename in JSP

前端 未结 4 2005
礼貌的吻别
礼貌的吻别 2020-12-28 17:42

Is there a way to get which JSP is currently rendered, with JSTL or Struts (or without)? like _ _ file _ _ in Python and PHP?

4条回答
  •  星月不相逢
    2020-12-28 18:08

    I succeeded using JSTL as following :

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

    And now, you should see as an HTML comment the name of the servlet produced by the container to render your JSP file, which name is very close to the JSP source file.

提交回复
热议问题