_Esam
asked on
How to use variables from a main JSP page to an included JSP page?
Hi,
I have a main JSP page where header, and two more JSP pages are included dynamically like:
In main.jsp page
<%@ include file="mainheader.jsp" %>
Now in the main.jsp page, there are some variables declared
like:
<%
String screen=null;
String sort=null;
String where=null;
%>
which are later used in the included JSP like mainheader.jsp as
if (userType == "E" && !screen.equals("asnhome")) {
String checkHacker = HttpHeaderParser.encodeStr ing(where) ;
}
Now RAD 7 shows these (screen, where) as errors in the mainheader.jsp page?
This app was initially built with WAS 5.1.2
I am trying to convert it to WAS 6.1
What is the problem here?
Thanks.
_Esam
I have a main JSP page where header, and two more JSP pages are included dynamically like:
In main.jsp page
<%@ include file="mainheader.jsp" %>
Now in the main.jsp page, there are some variables declared
like:
<%
String screen=null;
String sort=null;
String where=null;
%>
which are later used in the included JSP like mainheader.jsp as
if (userType == "E" && !screen.equals("asnhome"))
String checkHacker = HttpHeaderParser.encodeStr
}
Now RAD 7 shows these (screen, where) as errors in the mainheader.jsp page?
This app was initially built with WAS 5.1.2
I am trying to convert it to WAS 6.1
What is the problem here?
Thanks.
_Esam
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
will a request.setAttribute and a request.getAttribute work?
I believe my comment was correct because eventually when the application is run on the server, it won't give the same error as what the development IDE RAD is giving.
In order to avoid compilation error
you can try like this
<%@ include file="mainheader.jsp" %>
as
<%@ include file="mainheader.jspf" %>
Let me know if any concerns