views:

71

answers:

1

So I have a main JSP index page, "index.jsp", which has several includes. 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" %>

The "include.jsp" contains a 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 works just fine, but wondering what might be causing this, or if it can be resolved? Or maybe there's a way to make Eclipse ignore this? I just want the false positive red X's to go away. I suppose Eclipse doesn't understand that "navbar.jsp" is getting "basePath" from "include.jsp" because it is compiled together with "index.jsp".

+1  A: 

Eclipse is an epic failure with regard to JSP/EL validation. Just ignore it or disable all (or parts of) JSP/EL validation in workspace preferences through Validation and/or Web > JSP Files > Validation.

BalusC
Hey thanks, that works for me.
wsams
You're welcome.
BalusC