Can anyone help me with this validation error:
I have two jsp files, first one test1.jsp with a useBean declaration of the variable ‘test’, does an include directive with a second file test2.jsp where this variable ‘testVariable’ is used that was declared in test1.jsp.
The compiler gives: ‘testVariable’ cannot be resolved. Running the jsp with tomcat gives no problem at all. What can be wrong?
the files are
——————————————————————————-
test1.jsp
——————————————————————————–
<jsp:useBean class=”java.lang.String” id=”testVariable” scope=”request” />
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=ISO-8859-1″>
<title>Insert title here</title>
</head>
<body>
<h2>Begin test</h2>
<%@ include file=”test2.jsp” %>
</body>
</html>
——————————————————————————–
——————————————————————————–
test2.jsp
——————————————————————————–
<% testVariable = “test variable”; %>
<h2>Hello world</h2>
<h2><%= testVariable %></h2>
——————————————————————————–