facebook

JSP validation question

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #245791 Reply

    jleming
    Member

    For these issues, I am currently using the MyEclipse 4.1 with Eclipse version 3.1.0.

    Suppose I have the following jsp files:

    a.jsp:
    <%@include file=”b.jsp” %>

    b.jsp:
    <%@page import=”mypackage.*” %>
    <%

    bah.StaticMethod();

    %>

    … then, b.jsp compiles and validates just fine, but a.jsp will underline the include and complain about bah not existing.

    If I change a.jsp to the following:

    <%@page import=”mypackage.*” %>
    <%@include file=”b.jsp” %>

    Then, everything works fine … so for some reason, when validation is parsing a jsp file, it does not take into account the include’s imports.

    Secondly, the validation does not always seem to work right — I have to sometimes close the jsp files and re-open them for the validation to show correct information, despite the fact that I would modify the file and re-save it (which would cause validation to run again).

    Does anyone else have experience with these issues?

    #245799

    Riyad Kalla
    Member

    What is your Eclipse Build ID from your Help > About menu?

    Also what is your MyEclipse Build ID From your MYEclipse > About menu?

    Additionally is “bah” a class with the static method “StaticMethod()” on it, or is it an instance? This is why in my email to you I asked for a better example, this is still not clear to me.

    #245816

    jleming
    Member

    bah.java:

    package mypackage;

    public class bah {
    public static void StaticMethod() {
    doStuff();
    }
    }

    Eclipse build ID: I20050627-1435
    MyEclipse build ID: 20060122-4.1-GA

    #245818

    Riyad Kalla
    Member

    I cannot reproduce this, please point out where my code differs from yours:

    bah.java

    
    package com.test;
    
    public class bah {
        public static void StaticMethod() {
            /* no-op */
        }
    }
    

    a.jsp

    
    <%@ include file="b.jsp" %>
    

    b.jsp

    
    <%@ page import="com.test.bah" %>
    
    <%
     bah.StaticMethod();
    %>
    

    Everything builds/validates fine. Eclipse 3.1.1/MyEclipse 4.1/JDK 1.5.0_05/Windows XP Pro

    #245821

    jleming
    Member

    ok, the case is a bit more obscure that I originally thought. If i take b.jsp, and import something else (ie javax.servlet.*) so that b.jsp does not compile, then run validation on b.jsp, then a.jsp …. then change b.jsp so that it is correct (import com.test.bah), b.jsp validates fine, but a.jsp (which I still have open) still shows an error with the import file, even if I resave and revalidate this file. But if I close a.jsp, and reopen it, it seems to work fine.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: JSP validation question

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