HTTP Status 500 file not found error in jsp includ

2019-03-04 21:06发布

问题:

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

回答1:

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"/>