0

I have a file structure like this:

Hello World
+---Web Content
|   +---views
|   |   +---Components
|   |   |   +---component1.jsp
|   |   |   +---component1.js
|   |   +---Page1
|   |   |   +---page1.jsp

And I am trying to move the components folder into the Web Content directory (up one level)

However, I'm running into issues with using "${pageContext.request.contextPath}" in my jsp includes. They work in my component1.jsp file to include css and js files into a jsp:

<script type='text/javascript' src="${pageContext.request.contextPath}/views/Components/component1.js"></script>

(The above works)

...while they don't work in my page1.jsp when I am trying to include the component using the same request:

<%@ include file="${pageContext.request.contextPath}/views/Components/component1.jsp" %>

What is going on here? Does the page context request not work within <% %> tags? What is the equivalent for use within the <% %> tags?

efong5
  • 366
  • 1
  • 6
  • 21

0 Answers0