Re: how to load TLD with JspTabligs that are packaged within the jar?
Attila Szegedi <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Those errors are bogus - something we fixed since; it'll be released as 2.3.13. You can try an integration build JAR version (that will likely become 2.3.13) from <http://freemarker.org:8085/download/FM-BRANCH23/artifacts/build-64/Library/freemarker.jar > So if I inderstand you correctly, your template renders fine, it's just that you have this false ERROR message noise in your log, right? Attila. On 2008.04.17., at 16:33, Zemian Deng wrote: > Hi Attila, I just tried 2.3.11 and I still gets the same error > message. The strangest thing is despite the ERRORS, the request went > through fine and page is rendered. I just don't understand where and > why the errors shows up. Have you seen this before? (like said, it > only shows up if I use the public URL in JspTablibs, not a tld file > directly). > > 09:12:38 [http-7070-2] [arker.FreeMarkerView:276 ] Rendering > FreeMarker template [/WEB-INF/view/user/create.ftl] in > FreeMarkerView 'user/create' > Warning: validation was turned on but an org.xml.sax.ErrorHandler > was not set, which is probably not what is desired. Parser will use > a default ErrorHandler to print the first 10 errors. Please call > the setErrorHandler method to fix this. > Error: URI = "jndi:/localhost/spring-ftl/WEB-INF/web.xml", Line = > "3", : Document root element "web-app", must match DOCTYPE root > "null". > Error: URI = "jndi:/localhost/spring-ftl/WEB-INF/web.xml", Line = > "3", : Document is invalid: no grammar found. > Warning: validation was turned on but an org.xml.sax.ErrorHandler > was not set, which is probably not what is desired. Parser will use > a default ErrorHandler to print the first 10 errors. Please call > the setErrorHandler method to fix this. > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/c.tld", Line = "6", : Document root > element "taglib", must match DOCTYPE root "null". > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/c.tld", Line = "6", : Document is > invalid: no grammar found. > Warning: validation was turned on but an org.xml.sax.ErrorHandler > was not set, which is probably not what is desired. Parser will use > a default ErrorHandler to print the first 10 errors. Please call > the setErrorHandler method to fix this. > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/fmt.tld", Line = "6", : Document root > element "taglib", must match DOCTYPE root "null". > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/fmt.tld", Line = "6", : Document is > invalid: no grammar found. > Warning: validation was turned on but an org.xml.sax.ErrorHandler > was not set, which is probably not what is desired. Parser will use > a default ErrorHandler to print the first 10 errors. Please call > the setErrorHandler method to fix this. > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/fn.tld", Line = "6", : Document root > element "taglib", must match DOCTYPE root "null". > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/fn.tld", Line = "6", : Document is > invalid: no grammar found. > Warning: validation was turned on but an org.xml.sax.ErrorHandler > was not set, which is probably not what is desired. Parser will use > a default ErrorHandler to print the first 10 errors. Please call > the setErrorHandler method to fix this. > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/permittedTaglibs.tld", Line = "6", : > Document root element "taglib", must match DOCTYPE root "null". > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/permittedTaglibs.tld", Line = "6", : > Document is invalid: no grammar found. > Warning: validation was turned on but an org.xml.sax.ErrorHandler > was not set, which is probably not what is desired. Parser will use > a default ErrorHandler to print the first 10 errors. Please call > the setErrorHandler method to fix this. > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/scriptfree.tld", Line = "6", : Document > root element "taglib", must match DOCTYPE root "null". > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/scriptfree.tld", Line = "6", : Document > is invalid: no grammar found. > Warning: validation was turned on but an org.xml.sax.ErrorHandler > was not set, which is probably not what is desired. Parser will use > a default ErrorHandler to print the first 10 errors. Please call > the setErrorHandler method to fix this. > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/sql.tld", Line = "6", : Document root > element "taglib", must match DOCTYPE root "null". > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/sql.tld", Line = "6", : Document is > invalid: no grammar found. > Warning: validation was turned on but an org.xml.sax.ErrorHandler > was not set, which is probably not what is desired. Parser will use > a default ErrorHandler to print the first 10 errors. Please call > the setErrorHandler method to fix this. > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/x.tld", Line = "6", : Document root > element "taglib", must match DOCTYPE root "null". > Error: URI = "jar:file:/opt/projects/java2/.metadata/.plugins/ > org.eclipse.wst.server.core/tmp0/wtpwebapps/spring-ftl/WEB-INF/lib/ > standard-1.1.1.jar!META-INF/x.tld", Line = "6", : Document is > invalid: no grammar found. > 09:12:39 [http-7070-2] [et.DispatcherServlet:939 ] Cleared thread- > bound request context: > org.apache.catalina.connector.RequestFacade@7f562e > 09:12:39 [http-7070-2] [et.DispatcherServlet:543 ] Successfully > completed request > > > > On Thu, Apr 17, 2008 at 9:10 AM, Zemian Deng > <[email protected]> wrote: > My output of ${.version} is 2.3.12 > > Problem still exists. I will try to set back to 2.3.11 specifically > and see. > > > On Thu, Apr 17, 2008 at 3:55 AM, Attila Szegedi <[email protected]> > wrote: > What's the FreeMarker version you use? (If you don't know, put $ > {.version} in one of your templates and see what is printed out). > There was a bug with referencing taglibs through a public URL; it was > fixed in 2.3.11. > > Attila. > > On 2008.04.16., at 19:11, Zemian Deng wrote: > > Hi, Can someone help me here? > > > > On Mon, Apr 14, 2008 at 5:41 PM, Zemian Deng > > <[email protected]> wrote: > > Hi, > > > > When working with Spring, their spring.jar file included their TLD > > file, and when used together with JSP, we simply specify the URI > to http://www.springframework.org/tags/form > > and it works. But if I replace it in Freemarker template with > > <#assign form=JspTaglibs["http://www.springframework.org/tags/ > form"]> > > I get bunch of XML parsing error during runtime. > > > > My workaround is to extract the TLD file and place it in WEB-INF > > folder and then use it like this: > > <#assign form=JspTaglibs["/WEB-INF/resources/spring-form.tld"]> > > > > Is there more elegant way without extracting the TLD file? > > > > -- > > Thanks, > > Zemian Deng > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > FreeMarker-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/freemarker-user > > > > -- > Thanks, > Zemian Deng > > > > -- > Thanks, > Zemian Deng > ------------------------------------------------------------------------- ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone