Get current filename in JSP

前端 未结 4 1998
礼貌的吻别
礼貌的吻别 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:30

    This is a simple copy-paste solution:

    <%=this.getClass().getSimpleName().replaceFirst("_jsp","")%>
    

提交回复
热议问题