hi, i am using taglib in jsp but when i am calling taglib is is showing this error "/pager-demo.jsp(3): Error in using tag library uri='/taglib.tld' prefix='pg': description in TLD defines element multiple times probably occurred due to an error in /pager-demo.jsp line 3: <%@ taglib uri="/taglib.tld" prefix="pg" %> " i am unable to understand this error. pls help me out deepak ------------------
Simon Brown
sharp shooter, and author
Ranch Hand
Joined: May 10, 2000
Posts: 1860
posted
0
It looks like a problem with your taglib.tld file. Could you paste it in for us? Cheers Simon
deepak62002
Greenhorn
Joined: Aug 17, 2001
Posts: 9
posted
0
now it is showing this error "/pager-demo.jsp(80): extra info class com.jsptags.navigation.pager.PagerTagExtraInfo rejected the attributes for this instance of tag pager probably occurred due to an error in /pager-demo.jsp line 80: <pg ager maxIndexPages="<%=20%>"> " "---------------------this is my taglib------------------------" <?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.0</tlibversion> <jspversion>1.1</jspversion> <shortname>pg</shortname> <uri>http://jsptags.com/tags/navigation/pager</uri> <info> The Pager Tag Library helps generate Google[sm] and AltaVista� style search result navigators. It will take multiple pages worth of information, dynamically split it up into page sized pieces and generate a browsable index. It does this in a flexible way that allows designers to give the index just about any look desired. </info> <tag> <name>pager</name> <tagclass>com.jsptags.navigation.pager.PagerTag</tagclass> <teiclass>com.jsptags.navigation.pager.PagerTagExtraInfo</teiclass> <bodycontent>JSP</bodycontent> <attribute> <name>maxItems</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>maxPageItems</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>maxIndexPages</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>isOffset</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>param</name> <tagclass>com.jsptags.navigation.pager.ParamTag</tagclass> <bodycontent>empty</bodycontent> <attribute> <name>name</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <name>value</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>item</name> <tagclass>com.jsptags.navigation.pager.ItemTag</tagclass> <bodycontent>JSP</bodycontent> </tag> <tag> <name>index</name> <tagclass>com.jsptags.navigation.pager.IndexTag</tagclass> <bodycontent>JSP</bodycontent> </tag> <tag> <name>prev</name> <tagclass>com.jsptags.navigation.pager.PrevTag</tagclass> <teiclass>com.jsptags.navigation.pager.IndexTagExtraInfo</teiclass> <bodycontent>JSP</bodycontent> <attribute> <name>ifnull</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> <tag> <name>pages</name> <tagclass>com.jsptags.navigation.pager.PagesTag</tagclass> <teiclass>com.jsptags.navigation.pager.IndexTagExtraInfo</teiclass> <bodycontent>JSP</bodycontent> </tag> <tag> <name>next</name> <tagclass>com.jsptags.navigation.pager.NextTag</tagclass> <teiclass>com.jsptags.navigation.pager.IndexTagExtraInfo</teiclass> <bodycontent>JSP</bodycontent> <attribute> <name>ifnull</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag> </taglib> "--------------------this is my jsp---------------------------" <%@ page session="false" %> <%@ taglib uri="/taglib.tld" prefix="pg" %> <html> <head> <title>Pager Tag Library Demo</title> <% /* * Pager Tag Library * * Copyright (C) 2000 James Klicman <james@jsptags.com> * * The latest release of this tag library can be found at * http://jsptags.com/tags/navigation/pager/ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ %> <style type="text/css"> A.nodec { text-decoration: none; } </style> </head> <body bgcolor="#ffffff"> <table bgcolor="#ffcc00" width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td><table bgcolor="#3366cc" width="100%" border="0" cellspacing="0" cellpadding="4"> <tr> <td width="379"><a href="http://jsptags.com/"><img src="jsptags.gif" alt="<jsptags.com> logo" width="379" height="65" border="0"></a></td> <td width="100%" align="center"><a href="http://jsptags.com/tags/navigation/pager/" class="nodec"><font color="#ffffff" size="+2"><b> Pager Tag Library v1.1</b></font></a></td> </tr> </table></td> </tr> </table> <% String requestUri = request.getRequestURI(); int indexOfqm = requestUri.indexOf('?'); if (indexOfqm != -1) requestUri = requestUri.substring(0, indexOfqm); String style = request.getParameter("style"); %> <center> <table width="90%" cellpadding="4"> <tr> <td> <ul> <b>Style</b><br> <li><a href="<%= requestUri %>?style=simple">Simple</a> <li><a href="<%= requestUri %>?style=jsptags">JSPTags.com</a> <li><a href="<%= requestUri %>?style=altavista">AltaVista®</a> <li><a href="<%= requestUri %>?style=google"><font color="#0000cc">G</font><font color="#cccc00">oo</font><font color="#0000cc">g</font><font color="#00cc00">l</font><font color="#cc0000">e</font><small><sup>SM</sup></small></a> </ul> </td> <td width="100%"> This demo of the Pager Tag Library displays the web safe color palette as its data source. You can choose among the different sample index styles by clicking on the style name. </td> </tr> </table> <pg ager maxIndexPages="<%=20%>"> <pg aram name="style"/> <% /* keep track of style */ %> <hr> <table width="90%" cellspacing="4" cellpadding="4"> <% for (int i = 0; i < webPalette.length; i++) { %><pg:item> <tr><th bgcolor="<%= webPalette[i][0] %>"><font color="<%= webPalette[i][1] %>"><%= i + 1 %></font></th></tr></pg:item><% } %> </table> <hr> <pg:index> <% if ("jsptags".equals(style)) { %> <table bgcolor="#ffcc00" border="0" cellspacing="0" cellpadding="2"><tr><td><table bgcolor="#003399" width="100%" border="0" cellspacing="0" cellpadding="6"><tr><td align="center"><table border="0" cellspacing="0" cellpadding="0"><tr><td width="15" height="21"><img src="http://jsptags.com/images/pager/left.gif" width="15" height="21" border="0"></td> <th height="21" bgcolor="#3366cc" background="http://jsptags.com/images/pager/bg.gif" nowrap><font face="Lucida,San-Serif,Arial,Helvetica"> <pg rev>taglib <a href="<%= pageUrl %>" class="nodec"><font color="#ffcc00"><<</font></a> </pg rev> <pg ages> <% if (pageNumber == pagerPageNumber) { %><font color="#ffffff"><%= pageNumber %></font><% } else { %><a href="<%= pageUrl %>" class="nodec"><font color="#ffcc00"><%= pageNumber %></font></a><% } %> </pg ages> <pg:next> <a href="<%= pageUrl %>" class="nodec"><font color="#ffcc00">>></font></a> </pg:next> </font></th><td width="17" height="21"><img src="http://jsptags.com/images/pager/right.gif" width="17" height="21" border="0"></td></tr></table></td></tr></table></td></tr> </table> <% } else if ("google".equals(style)) { %> <table border=0 cellpadding=0 width=10% cellspacing=0> <tr align=center valign=top> <td valign=bottom><font face=arial,sans-serif size=-1>Result Page: </font></td> <pg rev ifnull="<%= true %>"> <% if (pageUrl != null) { %> <td align=right><A HREF="<%= pageUrl %>"><IMG SRC=http://www.google.com/nav_previous.gif alt="" border=0><br> <b>Previous</b></A></td> <% } else { %> <td><IMG SRC=http://www.google.com/nav_first.gif alt="" border=0></td> <% } %> </pg rev> <pg ages> <% if (pageNumber == pagerPageNumber) { %> <td><IMG SRC=http://www.google.com/nav_current.gif alt=""><br> <font color=#A90A08><%= pageNumber %></font></td> <% } else { %> <td><A HREF="<%= pageUrl %>"><IMG SRC=http://www.google.com/nav_page.gif alt="" border=0><br> <%= pageNumber %></A></td> <% } %> </pg ages> <pg:next ifnull="<%= true %>"> <% if (pageUrl != null) { %> <td><A HREF="<%= pageUrl %>"><IMG SRC=http://www.google.com/nav_next.gif alt="" border=0><br> <b>Next</b></A></td> <% } else { %> <td><IMG SRC=http://www.google.com/nav_last.gif alt="" border=0></td> <% } %> </pg:next> </tr> </table>
static boolean validInt(TagData tagData, String name) { Object val = tagData.getAttribute(name); if (val != null && val != TagData.REQUEST_TIME_VALUE && val instanceof String) { try { if (Integer.parseInt((String)val) < 0) return false; } catch (NumberFormatException e) { return false; } } return true; } } "pls help me "
deepak62002
Greenhorn
Joined: Aug 17, 2001
Posts: 9
posted
0
hi,Simon Brown this example is from site http://jsptags.com/tags/navigation/pager if u r able to run this code in weblogic pls intimate me i will thank ful to u deepak
------------------
Simon Brown
sharp shooter, and author
Ranch Hand
Joined: May 10, 2000
Posts: 1860
posted
0
What this means is that the PagerTagExtraInfo class is validating the attributes and returning false.
Check the values that you are using against those expected by the tag itself, and also that they are positive integers (as tested by the validInt method). Hope that helps Simon [This message has been edited by Simon Brown (edited September 03, 2001).]
Rahul Mahindrakar
Ranch Hand
Joined: Jul 28, 2000
Posts: 1829
posted
0
"deepak62002"
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements. Thanks.
deepak62002
Greenhorn
Joined: Aug 17, 2001
Posts: 9
posted
0
hi Simon Brown, in jsp i am passing "<pg ager maxIndexPages="<%=20 %>">" u mean to say that this value is returing false. simon,just try to deploy this code ,as all this code is avalible in site i have mention above . pls deploy in weblogic6.0 and let me know that whether u have sorted the problem. i will helpful if u will be help me out.as i have wasted my 10 day's in this example.as this is one of most important module of my project.