Problem with Tiles and Custom Tags
843838Apr 4 2007 — edited Apr 4 2007Hi! I've some problems with Struts and Tiles. My Tomcat doesn't execute custom tags within the pages I include with Tiles.
I've the following code:
/layouts/layout.jsp:
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<html:html>
<head>
<title><bean:message key="global.title"/></title>
</head>
<body>
<tiles:insert attribute="content"/>
</body>
</html:html>
index.jsp:
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<tiles:insert page="/layouts/layout.jsp" flush="true">
<tiles:put name="content" value="/common/menu.jspf"/>
</tiles:insert>
/common/menu.jspf:
<div id="navBar">
<div id="sectionLinks">
<h3>Section Links</h3>
<ul>
<li><html:link href="#">sectionLink</html:link></li>
<li><html:link href="#">sectionLink</html:link></li>
<li><html:link href="#">sectionLink</html:link></li>
<li><html:link href="#">sectionLink</html:link></li>
<li><html:link href="#">sectionLink</html:link></li>
<li><html:link href="#">sectionLink</html:link></li>
</ul>
</div>
</div>
Result:
menu.jspf's content is included in index.jsp but the <html:link> (or any other custom tag) isn't translated into <a> (like it should be).
Any ideas?
It's possible to do this, isn't it?
Where do I have to put the taglib directives?
Thanks