你的tld格式错了。<%@ taglib uri="taglib.tld" prefix="if" %>
<html>
<if:IfParameterEquals name="what" value="init"> Evaluates this if request.getParameter("what") equals to "init" </if:IfParameterEquals> <br>
Tags are: IfParameterExists evaluates the body of this tag if the specified parameter included into request. Parameters are: 1) name. Name of the request parameter IfParameterEquals evaluates the body of this tag if the specified parameter included into request equals to the specified value. Parameters are: 1) name. Name of the request parameter
2) value. Value to compare IfParameterNotEquals evaluates the body of this tag if the specified parameter included into request not equals to the specified value. Parameters are: 1) name. Name of the request parameter
2) value. Value to compare IfTrue evaluates the body of this tag if the specified expression is true. Parameters are: 1) cond. boolean expression </html>===========================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"><taglib>
<tlibversion>1.3</tlibversion>
<jspversion>1.1</jspversion>
<shortname>IfTags</shortname>
<uri>http://coldjava.hypermart.net/servlets/iftags</uri>
<info>Conditional tags</info><tag>
<name>IfParameterEquals</name>
<tagclass>com.cj.iftags.IfParameterEquals</tagclass>
<bodycontent>JSP</bodycontent>
<info>Execute body if parameter equals to the given value</info><attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute></tag><tag>
<name>IfParameterNotEquals</name>
<tagclass>com.cj.iftags.IfParameterNotEquals</tagclass>
<bodycontent>JSP</bodycontent>
<info>Execute body if parameter not equals to the given value</info><attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute></tag><tag>
<name>IfParameterExists</name>
<tagclass>com.cj.iftags.IfParameterExists</tagclass>
<bodycontent>JSP</bodycontent>
<info>Execute body if parameter exists</info><attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute></tag><tag>
<name>IfTrue</name>
<tagclass>com.cj.iftags.IfTrue</tagclass>
<bodycontent>JSP</bodycontent>
<info>Execute body if expression is true</info><attribute>
<name>cond</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute></tag></taglib>
<html>
<if:IfParameterEquals name="what" value="init"> Evaluates this if request.getParameter("what") equals to "init" </if:IfParameterEquals> <br>
Tags are: IfParameterExists evaluates the body of this tag if the specified parameter included into request. Parameters are: 1) name. Name of the request parameter IfParameterEquals evaluates the body of this tag if the specified parameter included into request equals to the specified value. Parameters are: 1) name. Name of the request parameter
2) value. Value to compare IfParameterNotEquals evaluates the body of this tag if the specified parameter included into request not equals to the specified value. Parameters are: 1) name. Name of the request parameter
2) value. Value to compare IfTrue evaluates the body of this tag if the specified expression is true. Parameters are: 1) cond. boolean expression </html>===========================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"><taglib>
<tlibversion>1.3</tlibversion>
<jspversion>1.1</jspversion>
<shortname>IfTags</shortname>
<uri>http://coldjava.hypermart.net/servlets/iftags</uri>
<info>Conditional tags</info><tag>
<name>IfParameterEquals</name>
<tagclass>com.cj.iftags.IfParameterEquals</tagclass>
<bodycontent>JSP</bodycontent>
<info>Execute body if parameter equals to the given value</info><attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute></tag><tag>
<name>IfParameterNotEquals</name>
<tagclass>com.cj.iftags.IfParameterNotEquals</tagclass>
<bodycontent>JSP</bodycontent>
<info>Execute body if parameter not equals to the given value</info><attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute><attribute>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute></tag><tag>
<name>IfParameterExists</name>
<tagclass>com.cj.iftags.IfParameterExists</tagclass>
<bodycontent>JSP</bodycontent>
<info>Execute body if parameter exists</info><attribute>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute></tag><tag>
<name>IfTrue</name>
<tagclass>com.cj.iftags.IfTrue</tagclass>
<bodycontent>JSP</bodycontent>
<info>Execute body if expression is true</info><attribute>
<name>cond</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute></tag></taglib>
解决方案 »
- 求个判断用户是否登录代码
- 用ant打包的区别
- 一个我解决不了的常见错误!!(关于bean)
- TOMCAT报错
- 帮个小忙。呵呵。简单的我没时间查。谢谢了。
- 如何用JbuilderX 把 java 文件生成可执行文件?高分(100)
- 统计一下.大家谈谈开发基于Internet/Intranet应用软件都使用哪些开发工具.并谈谈各自优缺点!!!!
- javabean俺不懂,哪位可以介绍以下这方面的电子书,谢谢先!
- JavaScript中的数组能否将变量传递到JSP中呢?如果能,又该如何传递呢?
- ajax局部切换内容求助
- 各位大侠快帮我看看下面的servlet出什么问题了
- 大虾救命!APACHE没有理睬JSP?!!!
template.jsp
---------------
<%@page errorPage="errorpage.jsp" %>
<%@page contentType="text/html;charset=GBK"%>
<%@ taglib uri="/WEB-INF/tlds/taglib.tld" prefix="j2ee" %><html>
<head>
<title>
<j2ee:insert parameter="HtmlTitle" />
</title>
</head> <body bgcolor="white">
<j2ee:insert parameter="HtmlBanner" />
<j2ee:insert parameter="HtmlTopIndex" />
<table height="85%" width="100%" cellspacing="0" border="0">
<tr>
<td valign="top">
<j2ee:insert parameter="HtmlBody" />
</td>
</tr>
<tr>
<td valign="top">
<j2ee:insert parameter="HtmlPetFooter" />
</td>
</tr>
<tr>
<td valign="bottom">
<j2ee:insert parameter="HtmlFooter" />
</td>
</tr>
</table>
</body>
</html>
注:在每个insert tag 中引入页面,机制是通过xml文件映射,在"htmlBody"中引入下面的jsp
文件:
wfs3400.jsp
------------------
<%@page contentType="text/html;charset=Gb2312"%><%@include file="/com/britc/capms/wfs/wfs0120/wfs0120.js" %><head>
<title>收发邮件—草稿箱</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body bgcolor="#FFFFFF" text="#000000"><%@ taglib uri="/WEB-INF/tlds/wfs-taglib.tld" prefix="wfs" %>
<table width="100%" border="0" align=center cellspacing="0" cellpadding="0" >
<tr>
<td height="40" valign="top"><span class="contenttitle">
<b></b></span><br>
<img src="/com/britc/capms/pub/images/line2.gif" width="250" height="5" align="left"> </td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<form name="viewForm" method="post" action="wfs3400">
<table border='0' cellspacing='1' cellpadding='2' align='center' class='tabline' width='100%'>
<tr>
<td width="6%" class="tabtitletd" height="20"> </td>
<td width="37%" class="tabtitletd" height="20">主题</td>
<td width="30%" class="tabtitletd" height="20">存入时间</td>
<td width="27%" class="tabtitletd" height="20">附件</td>
</tr>
<j2ee:recyclingRow redundantLocation1="3">
<%// 单双行显示不同的颜色
if( rowNo%2 == 1 )
styleClass = "tabtd1";
else
styleClass = "tabtd2";
%>
<tr class=<%=styleClass%> onMouseOver="mOvr(this);" onMouseOut="mOut(this);">
<td width="6%" >
<input type="radio" name="radiobutton" value=<%=recordArray[0]%> class="wfsinput">
</td>
<td width="37%" ><a href="javascript:mainTopic('<%=recordArray[0]%>')"><%=recordArray[1]%></a>
</td>
<td width="30%" ><%=recordArray[2]%></td>
<td width="27%" ><%=recordArray[3]%></td>
</tr>
</j2ee:recyclingRow >
<input type="hidden" name="flag">
</table>
</form>
</td>
</tr></body>
-------------------
taglib.tld
---------------------
?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"><!-- a tab library descriptor --><taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>j2ee</shortname>
<info>
WorkFlowSubsystem Tag Library gy GYP
</info> <!-- customized tag -->
<tag>
<name>recyclingRow</name>
<tagclass>com.britc.capms.wfs.taglib.WFS3400Tag</tagclass>
<teiclass>com.britc.capms.wfs.taglib.WFS3400ExtraInfo</teiclass>
<bodycontent>JSP</bodycontent>
<info>
从requestHandler返回的矢量在这里被取出并循环显示
</info>
<attribute>
<name>column</name>
<required>true</required>
</attribute>
<attribute>
<name>redundantLocation1</name>
<required>false</required>
</attribute>
<attribute>
<name>redundantLocation2</name>
<required>false</required>
</attribute>
<attribute>
<name>redundantLocation3</name>
<required>false</required>
</attribute>
</tag>
</taglib>
------------------
template.jsp
---------------
<%@page errorPage="errorpage.jsp" %>
<%@page contentType="text/html;charset=GBK"%>
<%@ taglib uri="/WEB-INF/tlds/taglib.tld" prefix="j2ee" %><html>
<head>
<title>
<j2ee:insert parameter="HtmlTitle" />
</title>
</head> <body bgcolor="white">
<j2ee:insert parameter="HtmlBanner" />
<j2ee:insert parameter="HtmlTopIndex" />
<table height="85%" width="100%" cellspacing="0" border="0">
<tr>
<td valign="top">
<j2ee:insert parameter="HtmlBody" />
</td>
</tr>
<tr>
<td valign="top">
<j2ee:insert parameter="HtmlPetFooter" />
</td>
</tr>
<tr>
<td valign="bottom">
<j2ee:insert parameter="HtmlFooter" />
</td>
</tr>
</table>
</body>
</html>
注:在每个insert tag 中引入页面,机制是通过xml文件映射,在"htmlBody"中引入下面的jsp
文件:
wfs3400.jsp
------------------
<%@page contentType="text/html;charset=Gb2312"%><%@include file="/com/britc/capms/wfs/wfs0120/wfs0120.js" %><head>
<title>收发邮件—草稿箱</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body bgcolor="#FFFFFF" text="#000000"><table width="100%" border="0" align=center cellspacing="0" cellpadding="0" >
<tr>
<td height="40" valign="top"><span class="contenttitle">
<b></b></span><br>
<img src="/com/britc/capms/pub/images/line2.gif" width="250" height="5" align="left"> </td>
</tr>
</table>
<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<form name="viewForm" method="post" action="wfs3400">
<table border='0' cellspacing='1' cellpadding='2' align='center' class='tabline' width='100%'>
<tr>
<td width="6%" class="tabtitletd" height="20"> </td>
<td width="37%" class="tabtitletd" height="20">主题</td>
<td width="30%" class="tabtitletd" height="20">存入时间</td>
<td width="27%" class="tabtitletd" height="20">附件</td>
</tr>
<j2ee:recyclingRow redundantLocation1="3">
<%// 单双行显示不同的颜色
if( rowNo%2 == 1 )
styleClass = "tabtd1";
else
styleClass = "tabtd2";
%>
<tr class=<%=styleClass%> onMouseOver="mOvr(this);" onMouseOut="mOut(this);">
<td width="6%" >
<input type="radio" name="radiobutton" value=<%=recordArray[0]%> class="wfsinput">
</td>
<td width="37%" ><a href="javascript:mainTopic('<%=recordArray[0]%>')"><%=recordArray[1]%></a>
</td>
<td width="30%" ><%=recordArray[2]%></td>
<td width="27%" ><%=recordArray[3]%></td>
</tr>
</j2ee:recyclingRow >
<input type="hidden" name="flag">
</table>
</form>
</td>
</tr></body>
-------------------
taglib.tld
---------------------
?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"><!-- a tab library descriptor --><taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>j2ee</shortname>
<info>
WorkFlowSubsystem Tag Library gy GYP
</info> <!-- customized tag -->
<tag>
<name>recyclingRow</name>
<tagclass>com.britc.capms.wfs.taglib.WFS3400Tag</tagclass>
<teiclass>com.britc.capms.wfs.taglib.WFS3400ExtraInfo</teiclass>
<bodycontent>JSP</bodycontent>
<info>
从requestHandler返回的矢量在这里被取出并循环显示
</info>
<attribute>
<name>column</name>
<required>true</required>
</attribute>
<attribute>
<name>redundantLocation1</name>
<required>false</required>
</attribute>
<attribute>
<name>redundantLocation2</name>
<required>false</required>
</attribute>
<attribute>
<name>redundantLocation3</name>
<required>false</required>
</attribute>
</tag>
</taglib>
------------------