Is there a way to get which JSP is currently rendered, with JSTL or Struts (or without)? like _ _ file _ _ in Python and PHP?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well … yes … in a way
I’m using a JSP called
pre.jspfor that which I include at the top of each JSP in my webapp:Plus I put this at the end of each JSP:
That gives me a consistent log. To make sure each JSP is "correct", I have a check in my build script which just looks for the two strings
"/pre.jsp"and “END <%=__jspName`.Note: There are many characters which are allowed in file names but not in Java class names. If you use them, your class names might look weird. If that’s the case, I suggest to create a static helper function which converts class names to File names and call that, i.e.
Each JSP compiler has it’s own rules; here is one example: http://itdoc.hitachi.co.jp/manuals/3020/30203Y0510e/EY050044.HTM
Kudos go to Marcus Junius Brutus for pointing that out.