facebook

JSP "errors" annoying :|

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

    gcormier
    Member

    I have a header.jspf which has some useBean tags. One of the beans for example, is called infoBean.

    So in a file, let’s say, main.jsp, I have

    
    <%@ include file="header.jspf">
    
    Test : <%= infobean.getSomething() %>
    
    

    However, the first line is highlighted saying infoBean may not have been initialized properly. And then in the main file, all the uses of infoBean are highlighted in red 🙁

    Is there either

    a) A way to ignore this error?
    b) Some hack I could use to get around this?
    c) A fix planned for ME?

    I’ve disabled ALL validators and still get this 🙁

    Thanks,
    Greg

    #236881 Reply

    Riyad Kalla
    Member

    How did you init infoBean in your header.jspf file?

    #236883 Reply

    gcormier
    Member

    <jsp:useBean id=”infoBean” class=”ca.gc.publiservice.boardroom.beans.InfoBean” scope=”session” />

    #236900 Reply

    Riyad Kalla
    Member

    If you comment that line our of the header and move it into the main.jsp, does the error go away, or does it still persist? I’m wondering fi the generated servlet code ends up looking like:
    ca.gc.publiservice.boardroom.beans.InfoBean infoBean;

    in which case the error is correct, it MIGHT not have been initialized (the Java compiler will give you the same error for source files).

    #236902 Reply

    gcormier
    Member

    I was thinking the same thing as you were, but since it’s a useBean tag, there’s nothing i can do. there’s no “defaultvalue” field i could set or something.

    If I paste it in the main.jsp, the warnings disappear 🙂

    #236903 Reply

    Riyad Kalla
    Member

    If I paste it in the main.jsp, the warnings disappear 🙂

    Hmm ok then this seems like a bug.

    Is the warning in the left or right margin of the editor?

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: JSP "errors" annoying :|

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