struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anjib Mulepati <anji...@hotmail.com>
Subject [S 1.3.8] Adding tag lib
Date Fri, 20 May 2011 19:03:57 GMT
Hi,

I have a query regarding adding tag lib in web pages while using tiles.
Is it enough to put tag lib directive in layout page only? Will all 
other pages loaded in layout get that?

Example

1. In tiles layout page I have

<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!doctype html>

<html>
<head>
<title><tiles:getAsString name="title" ignore="true" /></title>
</head>
<body>
<tiles:insert attribute="content" />
</body>
</html>

2. Now some other page (/jsp/login.jsp) can I just use tags without 
adding <%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>.

<html:link action="/login.do">Log-In</html:link>

3. My tiles definition file looks like

<tiles-definitions>

<definition name="basicLayout" path="/jsp/basicLayout.jsp">
<put name="title"   value=":: Main Page ::" />
<put name="content" value="" />
</definition>

<definition name="loginPage" extends="basicLayout">
<put name="title"   value=":: Login Page ::" />
<put name="content" value="/jsp/login.jsp" />
</definition>

</tiles-definitions>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message