facebook

JSP validation generating incorrect errors [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #220170 Reply

    mackking
    Member

    If I do JSP validation on the following code:

    
    <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> 
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html>
      <head>
        <title>My JSP 'testing.jsp' starting page</title>
      </head>
      
      <body>
        This is my JSP page. <br>
        <html:form action="someting" >
        <html:submit>Submit</html:submit>
        </html:form>
      </body>
    </html:html>
    

    I get the following validation errors:

    
    <html:html> cannot resolve symol: symbol : method doAfterBody()
    <html:form> cannot resolve symol: symbol : variable EVAL_BODY_AGAIN
    <html:submit> cannot resolve symol: symbol : variable EVAL_BODY_AGAIN
    

    I should mention that the Eclipse project this code is under is not an “original” MyEclipse project, but one that has had WebProject Capabilities added to it.

    Project directory structure is as follows:

    
      <project>/
                    /src
                    /web
                    /web/jsp
                    /web/WEB-INF
    

    When I added the WebProject Capabilities, I set the Web-Root folder to be ‘web’.

    Any help would be appreciated as we are seeing these misleading errors on ALL our JSPs, for both Struts tags as well as our own custom tags.

    Version Details:
    Eclipse: 3.0.1
    MyEclipse: 3.8.2+QF20041020

    #220172 Reply

    Riyad Kalla
    Member

    Mack,
    Please read this post to better understand what the URI for taglibs is used for and how it is resolved: http://www.myeclipseide.com/FAQ+index-myfaq-yes-id_cat-31.html#251

    #220228 Reply

    mackking
    Member

    OK, but we’ve got the following IN our web.xml

    
    <!-- Template Tag Library Descriptor -->
      <taglib>
        <taglib-uri>/WEB-INF/tld/security.tld</taglib-uri>
        <taglib-location>/WEB-INF/tld/security.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/WEB-INF/tld/struts-html.tld</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/WEB-INF/tld/struts-bean.tld</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/WEB-INF/tld/struts-logic.tld</taglib-uri>
        <taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
      </taglib>
    

    Should this mean that the TLDs would get picked up by rule #1 from the FAQ?

    #220232 Reply

    Riyad Kalla
    Member

    I think I was barking up the wrong tree:

    <html:html> cannot resolve symol: symbol : method doAfterBody()
    <html:form> cannot resolve symol: symbol : variable EVAL_BODY_AGAIN
    <html:submit> cannot resolve symol: symbol : variable EVAL_BODY_AGAIN

    Is your struts.jar file in your Java Build Path under your Library tab? Does this project build correctly if you rrebuild the entire thing?

    #220236 Reply

    mackking
    Member

    @support-rkalla wrote:

    I think I was barking up the wrong tree:

    Is your struts.jar file in your Java Build Path under your Library tab?

    Yes.

    Does this project build correctly if you rrebuild the entire thing?

    Yes.

    #220240 Reply

    Riyad Kalla
    Member

    Can you create a little sample project that exhibits this behavior and use FIle > Export > ZIP and send it to support@genuitec.com and reference this thread?

    #220263 Reply

    mackking
    Member

    Strangely enough, that’s proving harder then you’d think. *sigh*

    I have just witnessed a different error message though. On the <html:html> of the same jsp I got the following:

    
    handlePageExcetion(java.lang.Exception) in javax.servlet.jsp.PageContext cannot be applied to (java.lang.Throwable):  if(_jspx_page_context != null) _jspx_page_context.handlePageException(t);
    
    #220264 Reply

    mackking
    Member

    Strangely, if I do a “Remove Validation Markes” and then re-validate the JSP, the error on the <html:html> tag reverts back to the doAfterBody error.

    #220433 Reply

    mackking
    Member

    I guess you can close this thread now, I’ve figured out the problem.

    We have a support project in Eclipse that contains the various JARs we compile against in them. As it turns out, there were 2 different versions of servlet.jar in there, and depending on which one you had set for the classpath you either would, or wouldn’t get the validation errors on the JSP.

    I’m guessing the problem JAR is an older version that supports an older Servlet or JSP standard, but the JAR isn’t named very informatively, and the Manifest file is useless.

    Thanks for the help guys.

Viewing 9 posts - 1 through 9 (of 9 total)
Reply To: JSP validation generating incorrect errors [Closed]

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