Ooops, I just noticed that when I uploaded my file to the validator the offending elements were commented-out inside <!-- and --> tokens. Uncommenting and a closer look at the DTD revealed that the <context-param>, while a child of the correct parent node, did not occur in the right order it must occur in the order specified by the following part of the DTD:
<!ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*)> ... so I put it after the description (as I do not have the optional distributable element in my web.xml file: I don't use it). Now that I fixed that the error is gone! Thanks! Neil On Sun, 6 Jul 2003, Neil Zanella wrote: > > Excellent idea. I should have a look at the document type definition for > the web.xml file to find out where exactly I should place the > context-param element and its contents, and then perhaps also > validate the resulting XML file with an XML validator with > the DTD also supplied as input. > > The DTD does not come with tomcat or taglibs but... > > $ find /usr/local/jakarta-tomcat-4.1.24 -name '*dtd' > $ find /usr/local/jakarta-taglibs -name '*dtd' > $ > > The file /usr/local/jakarta-tomcat-4.1.24/webapps/ROOT/WEB-INF/web.xml > reveals its location: > > http://java.sun.com/dtd/web-app_2_3.dtd > > OK, I validated the page versus the DTD using the XML validator at > http://validator.w3.org/ and found the page to be valid XML, that > is the XML file is well-formed and validates versus the DTD. > > I also checked it at the following site: > http://www.stg.brown.edu/cgi-bin/xmlvalid/xmlvalid.pl > and obtained the same results (except for the following > warning which I suppose is nothing to worry about): > > line 2, web.xml: > warning (562): can't resolve Public ID: -//Sun Microsystems, Inc.//DTD > Web Application 2.2//EN > > Both validators nevertheless downloaded the DTD from the contents of > the second string specified in the document type declaration and did > find the document to conform to the DTD, so that was not the problem. > > The error message reported is clearly wrong. > > Regards, > > Neil > > On Sat, 5 Jul 2003, N. Chen wrote: > > > do you have <taglib> define in the web.xml file? might be the ordering of > > your other directives, try looking at the DTD. > > > > nick > > > > On Fri, 4 Jul 2003, Neil Zanella wrote: > > > > > > > > Well, now I am not entirely sure that it is mandatory, because I have > > > a JSP page such that when I change the WEB-INF/web.xml to include the > > > following lines (for connecting to a database which is not yet on the > > > network): > > > > > > <context-param> > > > <param-name> > > > javax.servlet.jsp.jstl.sql.dataSource > > > </param-name> > > > <param-value> > > > jdbc:postgresql:foodb,org.postgresql.Driver,johndoe > > > </param-value> > > > </context-param> > > > > > > and save the .jsp file without making any modifications to it, I get > > > the following error, but the error is not caused by a change in the > > > .jsp file; it's caused by the above lines: > > > > > > org.apache.jasper.JasperException: This absolute uri > > > (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or > > > the jar files deployed with this application > > > > > > This is clearly wrong!!! BTW I have not been able to connect to the data > > > source yet so I'm not sure yet if that would fix it, but the error is > > > clearly the wrong error, and is introduced by the above lines. > > > > > > Why is this happening? (almost would seem like a bug: Tomcat 4.1.24) > > > > > > Neil > > > > > > On Mon, 30 Jun 2003, Shawn Bayern wrote: > > > > > > > On Mon, 30 Jun 2003, [gb2312] guo yingshou wrote: > > > > > > > > > If it is *mandatory*,why the web-app.dtd still specifiy an optional > > > > > taglib element?Just for backward compatibility? > > > > > > > > That's part of it, and it's also necessary for cases where a tag library > > > > doesn't package its JAR in the format necessary for it to work. Note that > > > > it's mandatory for the container to support it; it's not mandatory for a > > > > taglib author to deploy his or her libraries in this fashion (though it's > > > > probably a good idea in all cases). > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
