I am trying to use piece tags in my JSP file. The code in the tag file (base tag) is as follows:
& lt;% @ tag description = "full page template" page encoding = "UTF-8"%> & Lt;% @ attribute name = "nav" fragment = "true"%> & Lt;% @ attribute name = "css" piece = "true"%> & Lt;% @ attribute name = "js" fragment = "true"%> & Lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Jsp: invitation piece = "css" /> & Lt; Jsp: invitation piece = "navy" /> & Lt; Jsp: doBody / & gt; & Lt; Jsp: invitation piece = "js" /> & Lt; / Body & gt; & Lt; / Html & gt;
8859-1 "page encoding =" UTF-8 "%> & Lt;% @ Page Import = "java.util.ArrayList"% & gt; & Lt;% @ taglib prefix = "T" tagder = "/ web-ANF / tag"% " & Lt; T: Base & gt; & Lt; Jsp: attribute name = "nav" & gt; & Lt; Jsp: include page = "nav.jsp" /> & Lt; / Jsp: attribute & gt; & Lt; Jsp: body & gt; & Lt; P & gt; Hi & lt; / P & gt; & Lt; / Jsp: body & gt; & Lt; Jsp: attribute name = "js" & gt; & Lt; P & gt; Hi & lt; / P & gt; & Lt; / Jsp: attribute & gt; & Lt; / T: base & gt;
If I extract my code, then my code works fine - otherwise I am not finished ": base" error I am using tonkat 7.x if any Other information is also required, so I will also post it here. But as I am new to Tomcat / JSP / Servlets, I am very helpless.
Yo needs to define all first attributes:
& lt;% @ page language = "java" contentType = "text / html; Charset = ISO-885 9-1 "page encoding =" UTF-8 "%> gt; page @ import =" java.util.ArrayList "%> <% @ taglib prefix =" t "Tag" = "/ Web-ANF / Tag"%> gt; & lt; base & gt; & lt; jsp: attribute name = "js" & gt; & lt; p & gt; high & lt; / P & gt; & lt; / jsp: attribute & gt; & lt; jsp: attribute name = "nav" & gt; & lt; jsp: include page = "nav.jsp" /> & lt; / jsp : Specialty & gt; & lt; jsp: body & gt; & lt; p & gt; Hi & lt; / p & gt; & lt; / jsp: body & gt; & lt; / t: Base & gt;
No comments:
Post a Comment