Hi I need an urgen help.. Please try helping me.. ! Thanks in advance.. Environment Running under: JBoss Version : 4.0.2 | JDK Version : 1.4.2 | | I am using the Custom Tag Lib to iterate over the data. I am having a problem with the output of the jsp while using the custom tag lib. | | The output from Jsp Page when accessed first time is : | | anonymous wrote : Hello | | Hello Again | | Hello Again | | Hello Again | | When I try to re-visit the page or refresh the page again then the output from the Jsp Page is : | | anonymous wrote : Hello | | Hello Again | | The source code: | | RepeatHelloTag.java: | | | | | package com.masslight.tagExampleClasses; | | | | import javax.servlet.jsp.*; | | import javax.servlet.jsp.tagext.*; | | import java.io.*; | | | | public class RepeatHelloTag extends javax.servlet.jsp.tagext.BodyTagSupport { | | int count = 1; | | int numberOfIterations = 3; | | String greeting = new String("Hello <BR>"); | | public int doStartTag() throws JspTagException { | | try { | | pageContext.getOut().print(greeting); | | } catch (Exception ex) { | | throw new JspTagException("IO problems"); | | } | | return EVAL_BODY_BUFFERED; | | } | | public int doAfterBody() throws JspTagException { | | try { | | if (count < numberOfIterations) { | | count++; | | return EVAL_BODY_BUFFERED; | | } | | else { | | BodyContent bodyContent = getBodyContent(); | | bodyContent.writeOut(getPreviousOut()); | | return SKIP_BODY; | | } | | } | | catch (Exception e) { | | throw (new JspTagException("error")); | | } | | } | | } | | | | The Jsp File : | | | tagExample.jsp | | <%@ page language="java" %> | | <%@ taglib uri="WEB-INF/tagExampleLib.tld" prefix="greeter" %> | | <html> | | <body> | | <greeter:RepeatHello> | | Hello Again<br> | | </greeter:RepeatHello> | | </body> | | </html> | | The TLD file : | | tagExampleLib.tld | | <?xml version="1.0" encoding="ISO-8859-1" ?> | | | | <taglib xmlns="http://java.sun.com/xml/ns/j2ee" | | xmlns:xsi="htpp://www.w3.org/2001/XMLSchema-instance" | | version="2.0"> | | <tlibversion>1.0</tlibversion> | | <jspversion>2.0</jspversion> | | <shortname>utility</shortname> | | <info> | | A simple tag library for the examples | | </info> | | <tag> | | <name>RepeatHello</name> | | <tagclass>com.masslight.tagExampleClasses.RepeatHelloTag</tagclass> | | <bodycontent>JSP</bodycontent> | | <info>Print Hello Multiple Times</info> | | </tag> | | </taglib> | | The Web.xml: | | <?xml version="1.0" encoding="ISO-8859-1"?> | | | | <!DOCTYPE web-app | | PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" | | "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> | | | | <web-app> | | <taglib> | | <taglib-uri>/WEB-INF/tagExampleLib.tld</taglib-uri> | | <taglib-location>/WEB-INF/tagExampleLib.tld</taglib-location> | | </taglib> | | </web-app> | | Regards | Baba S
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3936495#3936495 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3936495 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user