taglib

Hello All...

I have a jsp like this:

<%@include file="includeDirec.jsp"%>

<html>

<head>

<%@ include file="includefiles.jsp" %>

</head>

<body>

<div class="header">

<c:import url="header.jsp"/>

</div>

<div class="side-bar">

<c:import url="sideBar.jsp" />

</div>

<div class="content">

<%-- code here --%>

</div>

<div class="footer">

<c:import url="footer.jsp" />

</div>

</body>

</html>

includeDirec.jsp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>

<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>

--includefiles.jsp

<meta http-equiv="content-type" content="text/html; charset=utf-8"/>

<title></title>

<link rel="stylesheet" type="text/css" href="style/css.css"/>

<script type='text/javascript' src='jscript/js.js'></script>

My question is I need to use jstl in my header.jsp and hence

<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>

<%@taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%> are to be added in header.jsp ...can I add it again in header.jsp...

Thanks,

Greeshma

[1544 byte] By [Greeshma12a] at [2007-11-27 4:44:11]
# 1

Have you tried it? Yes you can, and you should.

<%@include %> is like a copy/paste of the .jsp file into your current jsp file. It happens at compile time.

<c:import> acts like <jsp:include> in the case of local references, and puts the result of executing the url into the output stream at runtime.

Therefore anything invoked by <c:import> needs to declare the taglibraries in its own right.

evnafetsa at 2007-7-12 9:56:06 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks,I have implemented it but just want to clarify whether we can do it in this manner...and the only way to include in the <head> is static as I have done is it right ?Thanks,Greeshma
Greeshma12a at 2007-7-12 9:56:06 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...