MyEclipse: JSP validation generating incorrect errors [Closed]

mackking - Nov 29, 2004 - 09:16 PM
Post subject: JSP validation generating incorrect errors [Closed]
If I do JSP validation on the following code:

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:

Code:

<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:
Code:

  <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
support-rkalla - Nov 29, 2004 - 09:21 PM
Post subject:
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
mackking - Nov 30, 2004 - 03:27 PM
Post subject:
OK, but we've got the following IN our web.xml

Code:

<!-- 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?
support-rkalla - Nov 30, 2004 - 03:49 PM
Post subject:
I think I was barking up the wrong tree:
Quote:

<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?
mackking - Nov 30, 2004 - 04:07 PM
Post subject:
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.

Quote:

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


Yes.
support-rkalla - Nov 30, 2004 - 04:17 PM
Post subject:
Can you create a little sample project that exhibits this behavior and use FIle > Export > ZIP and send it to support@myeclipseide.com and reference this thread?
mackking - Nov 30, 2004 - 05:39 PM
Post subject:
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:

Code:

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);

mackking - Nov 30, 2004 - 05:43 PM
Post subject:
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.
mackking - Dec 02, 2004 - 02:06 PM
Post subject: Bah... I've figured it out...
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.
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits