Skip to main content

Java problem with include

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
maxbrown75
Offline
Joined: 2010-11-18

I'm trying to validate mvnForum with Eclipse. This development environment gives me error undeclared variable, having a number of files one within the other: in a file I have included the use of the variable and in the other I have the variable declaration, so Eclipse give error.
How can I avoid receiving these errors?
Alternatively, what kind of development environment I can use?

I have a file with this code:
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="net.myvietnam.mvncore.util.ParamUtil" %>
<%@ include file="inc_common.jsp"%>
<%@ include file="inc_doctype.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<mvn:html locale="${currentLocale}">

...

<%@ include file="header.jsp"%>
<br/>
<table width="95%" align="center">

...

<%@ include file="footer.jsp"%>
</mvn:body>
</mvn:html>
</fmt:bundle>

So in inc_common.jsp, i have:
...
String contextPath = request.getContextPath();
...
and in header.jsp i have:
...
<img src="<%=contextPath%>/mvnplugin/mvnforum/images/icon/search.gif" alt="<fmt:message key="mvnforum.common.action.search"/>" title="<fmt:message key="mvnforum.common.action.search"/>" hspace="0" vspace="0" border="0" align="bottom"/>
...
where Eclipse see contextPath like an error with this declaration>
"contextPath cannot be resolved to a variable"

Can I set up Eclipse to concatenate files and show him the files included?