- This topic has 3 replies, 2 voices, and was last updated 21 years, 5 months ago by support-michael.
-
AuthorPosts
-
fredbMemberHi MyEclipse Support,
I am getting JSP compilation errors, due to variables not being declared, that are declared in the included JSP pages! 🙁 Is there anyway around this error? ❓
Kind Regards
Fred
support-michaelKeymasterFred,
Can you provide more info to help us better understand this problem. Minimally we need your OS, versions of Eclipse and MyEclipse.
Also, how are your JSP pages configured? Is it something like this:
1) MainPage.jsp composed of InclPage1.jspf … InclPageN.jspf
2) InclPage1.jspf contains variable declarations that are referenced by InclPageN.jspf.Michael
MyEclipse Support
fredbMemberHi Michael,
OS: WinXP Professional SP 1
Eclipse 2.1.1
MyEclipse 2.5.1You’re 100% correct on your assumption. Here’s how it is:
1. mainPage.jsp includes pageHeader.jsp and errorPage.jsp
2. pageHeader.jsp contains a variable declaration: String errorHeading;
3. errorPage.jsp contains a table that displays the contents of the errorHeading variable – breaks cuz errorHeading is not declared within errorPage.jsp.We know that we will include the declaration… but MyEclipse doesn’t. Basically need some way of notifying Eclipse that the page is dependent on another jsp page.
Hope this helps,
Regards
Fred
support-michaelKeymasterSounds like the included JSPs are being compiled as if they are standalone JSPs. According to the JSP spec the file extension .jsp is reserved for top-level JSPs. Included JSPs known as fragements should use a different file extension, e.g., jspf, jsf. The MyEclipse JSP compiler will compile all .jsp files as if they are top-level JSPs which I believe is the problem here from your description of the include file extensions. Checkout this thread and see if it is relevant to your situation:
https://www.genuitec.com/forums/topic/using-jsf-for-a-jsp-fragment-closed/&highlight=jspf
Michael
MyEclipse Support -
AuthorPosts