I am using netBeans and glassFish Server 4.1.1
<%@ taglib uri="index.html" prefix="mytag" %>
<html>
<body>
<mytag:currentDate/>
</body>
</html>
And I got error like this:
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 7; The element type "meta" must be terminated by the matching end-tag "". at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1750) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2970) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:298) at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:351) at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:340) at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:254) at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:502) at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:582) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1657) at org.apache.jasper.compiler.Parser.parse(Parser.java:185) at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:244) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:145) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:212) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) at org.apache.jasper.JspC.processFile(JspC.java:1171) at org.apache.jasper.JspC.execute(JspC.java:1338) at org.netbeans.modules.web.project.ant.JspC.main(JspC.java:101) at org.netbeans.modules.web.project.ant.JspCSingle.main(JspCSingle.java:119) org.apache.jasper.JasperException: file:C:/Users/Queue/OneDrive/JspExE/build/web/WEB-INF/tlb.jsp(1,44) PWC6178: XML parsing error on file /WEB-INF/index.html: (line 12, col 7) org.apache.jasper.JasperException: C:/Users/Queue/OneDrive/JspExE/build/web/WEB-INF/tlb.jsp(1,44) org.apache.jasper.JasperException: file:C:/Users/Queue/OneDrive/JspExE/build/web/WEB-INF/tlb.jsp(1,44) PWC6178: XML parsing error on file C:\Users\Queue\OneDrive\JspExE\nbproject\build-impl.xml:936: Java returned: 1 BUILD FAILED (total time: 1 second)
The file
index.html
is a html file. You can't use HTML instead of TLD in the URI attribute oftaglib
directive.From the java tutorial: