jsp - Extending views in spring 4 -
i want create view file extends layout.jsp. used jstl , tags folder, layout /web-inf/tags/
looks this:
<%@tag description="main layout" pageencoding="utf-8" %> <%@attribute name="head" fragment="true" %> <%@attribute name="footer" fragment="true" %> <!doctype> <html> <head> <jsp:include page="../partials/defaulthead.jsp"> <jsp:invoke fragment="head"/> </head> <body> <header> <jsp:include page="../partials/header.jsp"> </header> <main> <jsp:dobody> </main> <footer> <jsp:include page="../partials/footer.jsp"> </footer> </body> </html>
and view:
<%@page contenttype="text/html" pageencoding="utf-8"%> <%@taglib prefix="t" tagdir="/web-inf/tags" %> <t:main> content of website. </t:main>
i have jstl , taglibs-c libraries installed (maven, pom.xml). , problem keep getting following error:
no tag "main" defined in tag library imported prefix "t"
what's wrong?
you mentioned in comment
forgot mention - layout file indeed named main.jsp, should work
it won't work. change file name main.tag
Comments
Post a Comment