facebook

JSP compilation error

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #197785 Reply

    fredb
    Member

    Hi 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

    #197786 Reply

    support-michael
    Keymaster

    Fred,

    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

    #197788 Reply

    fredb
    Member

    Hi Michael,

    OS: WinXP Professional SP 1
    Eclipse 2.1.1
    MyEclipse 2.5.1

    You’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

    #197789 Reply

    support-michael
    Keymaster

    Sounds 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

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: JSP compilation error

You must be logged in to post in the forum log in