The error "someVariable cannot be resolved" indicated in Eclipse for enabled JSP

So, I have a JSP index main page, "index.jsp", in which there are several. Something like,

<%@ include file="/WEB-INF/views/includes/jstl/include.jsp" %> <%@ include file="/WEB-INF/views/includes/licenses/license.jsp" %> <%@ include file="/WEB-INF/views/includes/generalHtml/header.jsp" %> <%@ include file="/WEB-INF/views/includes/navigation/navbar.jsp" %> <%@ include file="/WEB-INF/views/includes/generalHtml/footer.jsp" %> 

"include.jsp" contains the string "String basePath = request.getContextPath ();".

"navbar.jsp" uses "basePath", but Eclipse puts a red X on any line of "navbar.jsp" that uses "basePath" with the message "basePath cannot be resolved".

My webapp is working fine, but I wonder what could be causing this, or if it can be solved? Or maybe there is a way to make Eclipse ignore this? I just want the false positive red X to disappear. I believe that Eclipse does not understand that "navbar.jsp" gets "basePath" from "include.jsp" because it is compiled with "index.jsp".

+12
java eclipse include validation jsp
Feb 15 2018-10-15
source share
1 answer

Eclipse is an epic failure regarding JSP / EL validation. Just ignore it or disable all (or parts) of JSP / EL validations in the workspace settings through Validation and / or Web> JSP Files> Validation.

+16
Feb 15 '10 at 20:34
source share



All Articles