문제

I have spring mvc application using apache tiles.Main file is template.jsp which includes header.jsp, then got place for potential messages and footer.jsp included. Is there a way to check within jsp page ( using JSTL ) on which page I'm inside header.jsp code ? Normal way of getting page URL are not good because

${pageContext.request.servletPath}

Always get's me the page I supposed to be so , template:

/WEB-INF/tiles/template.jsp

Is there a way to do it somehow , without adding anything to model from within spring?

(Because this is one of way to do this )

도움이 되었습니까?

해결책

You can access the page URL (as it would appear in the browser) using the following EL in your JSP:

${requestScope['javax.servlet.forward.request_uri']}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top