Search code examples
jspfilenotfoundexceptionhttp-status-code-500jspinclude

HTTP Status 500 file not found error in jsp include


I include file from my root directory. Its working fine in local but when I host my site its give me:

error HTTP Status 500: "../connection.jsp" not found

My files are in

public_html/myfolder/connection.jsp

on shared hosting.

I want to include file in

public_html/myfolder/process/user-login.jsp


Solution

  • If public_html is a root folder of your web application, then you can use absolute path to the included resource.

    <jsp:include page="${pageContext.request.contextPath}/myfolder/connection.jsp"/>