Custom tag error

I'm tring to create a new JSF custom tag. my custom tag inherits from another custom tag called tab.
the tld look like this :
<taglib>
<tlib-version>1.0</tlib-version>
     <jsp-version>1.2</jsp-version>
<short-name>actab</short-name>
<uri>http://jsftutorials.com/</uri>
<tag>
<name>actab</name>
<tag-class>com.ca.accesscontrol.tabs.monolithic.ACTabTag</tag-class>
<body-content>JSP</body-content>
<attribute>
          <name>include</name>
     </attribute>
<attribute>
     <name>name</name>
     <required>true</required>
     <rtexprvalue>false</rtexprvalue>
     <description>Tab name to be displayed on this tab.</description>
     </attribute>
<attribute>
          <name>id</name>
     </attribute>     
</tag>
</taglib>
I'm tring to use the custom tag in the jsp, when I specify the attrbute name I get the following error:
monolithic.jsp(14,13) Attribute name invalid according to the specified TLD
when I remove the name attribute from the jsp I get the following error :
monolithic.jsp(13,10) According to the TLD attribute name is mandatory for tag actab.
does anyone have an idea about what the problem is ?

a bit more info required I think.
Is there more to that exception than you posted - coming from your code?
Maybe you can put try/catch code in your Tag source file to catch and print any exceptions that occur.
Beans property conversion would indicate that it has translating one type to another.
What attributes does this tag take. Should width be an integer - and 96% causes it an error?
Lets see the tld file, and maybe some basic source?

Similar Messages

  • Custom Tag Error with Weblogic SP9

              Hi
              I seem to be having a problem with a custom tag that I wrote. When I run the JSP
              on WLS (without a service pack), the generated java code uses the weblogic.utils.StringUtils
              class to interprete jsp expressions that are passed into the custom tag's attribute
              (on the JSP). The method called on this StringUtils class is valueOf(). This method
              in essence makes sure that the result of the expression is not null and then subsequently
              calls a toString() on the value. Note that if the value is null it simply returns
              an empty string.
              The problem is that when we go to service pack 9, this method is not called (StringUtils.valueOf()).
              Now the problem arises if first of all the result of the expression statement
              in the custom tag definintion (on the JSP) is null. Secondly, it will also error
              out when the setter method is called within the custom tag, if the object returned
              from the expression does not match the one that is expected by the tag... in our
              case a String.
              Here's a sample usage of the tag:
              <wescombop:selectTag
              selectName="buildingNumber"
              selectedItem="<%= buildingJB.getBuildingNumber()%>"
              trimSelectedItem="true"
              selectTagDataName="buildingNumberDataAttribute" />
              Note: buildingJB.getBuildingNumber() returns BigDecimal
              Here's a snipett of the line generated java:
              * Without the service pack
              comwestfieldgrp_wescom_bop_view_tag_SelectTag_1.setSelectedItem(weblogic.utils.StringUtils.valueOf(buildingJB.getBuildingNumber()));
              *With Service Pack 9
              comwestfieldgrp_wescom_bop_view_tag_SelectTag_1.setSelectedItem(buildingJB.getBuildingNumber());
              Note: The setSelectedItem() method expects a String object as a parameter, so
              the code with service pack 9 will result in a compilation error, since buildingJB.getBuildingNumber()
              returns a BigDecimal.
              Let me know if you need more explanation.
              Has anyone experience this problem before... Any help would be deeply appreciated.
              Thanks all.
              Niran
              

              Modify the <cewolf:param> tag.
              <cewolf:chart id="confchart" title="Reports" type="bar3d" yaxislabel="Time"> <cewolf:data>
              <cewolf:producer id="report"> <cewolf:param name="type" value="all" > </cewolf:param>
              </cewolf:producer> </cewolf:data> </cewolf:chart>
              "Balakrishnan" <[email protected]> wrote:
              >
              >We are using cewolf charting library in weblogic 7.0. The charting library
              >is implemented
              >as custom jsp tag library module.
              >
              >However, when the use the tag for displaying the chart, weblogic is producing
              >this compiler error.
              >
              >/reports/reportsView.jsp(108): no corresponding open tag for tag extension
              >close:
              >//[ null; Line: 108]
              >
              >Here's the corresponding source of the jsp file:
              >
              > <cewolf:chart id="confchart" title="Reports" type="bar3d" yaxislabel="Time">
              > <cewolf:data>
              > <cewolf:producer id="report">
              > <cewolf:param name="type" value="all" /> (<-- Error occurs
              >here.
              >Line no: 108)
              > </cewolf:producer>
              > </cewolf:data>
              > </cewolf:chart>
              >
              >I've also checked the corresponding tld file and it is in place.
              >
              >The same code without any modifications is working fine in tomcat. Can
              >you please
              >let me know what needs to be corrected to make this work?
              

  • JSP with Custom tags error during verify.

    Hi, i am new to JSP and Custom tag Library. The tools that i am using to deploy is "Sun Deploy Tool 8.2" with Sun Application Server. When i try to verify my JSP page i get this error message
    tests.web.AllJSPsMustBeCompilable . I guess there is nothing wrong for my code, will it be path problem, because
    i already check that i had included all the path that i need. Any idea what might cause this problem? Thank You.
    Assertion:All the JSPs that are bundled inside a web application must be compilable using a J2EE compliant JSP compiler that does not have any proprietary or optional features in it.
    For [ /tag/tag.war ]
    Error: Some JSPs bundled inside [ tag ] could not be compiled. See details below.
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 12 in the jsp file: /currentTime.jsp
    Here are my class file :
    Custom lib java Class timetag.java
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.jsp.*;
    import java.text.SimpleDateFormat;
    public class timetag extends TagSupport{
         public int doEndTag() throws JspException
              SimpleDateFormat sdf;
              sdf = new SimpleDateFormat("HH:mm:ss");
              String time = sdf.format(new java.util.Date());
              try {
                   pageContext.getOut().print(time);
              }catch(Exception ex)
                   throw new JspException(ex.toString());
              return EVAL_PAGE;
    Tag file *.tld : examplesTag.tld
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <taglib xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
    version="2.0">
    <tlib-version>1.0</tlib-version>
    <jsp-version>2.0</jsp-version>
    <short-name>ExamplesTags</short-name>
    <description>A set of example tag handlers.</description>
    <tag>
    <name>time</name>
    <tag-class>timetag</tag-class>
    </tag>
    </taglib>
    JSP File : currentTime.jsp
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ taglib prefix="examples" uri="/WEB-INF/examplesTags.tld" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <title>Insert title here</title>
    </head>
    <body>
    <examples:time /> //If i remove this it will be fine.
    </body>
    </html>

    I am sorry for the double post because the format mess up..Please ignore this POST..Apologies again..Thanks

  • Custom tag error in running OJSP 1.1 on iAS Solaris

    I got an error in running the customtag demo that comes with iAS. Any idea?
    Request URI:/demo/customtag/exampletag.jsp
    Exception:
    oracle.jsp.parse.JspParseException: Line # 2, <%@ taglib prefix="foo" uri="/WEB-INF/exampletag.tld" %> Error: Unable to load taghandler class:
    /WEB-INF/exampletag.tld
    null

    I had this problem, got jdk reinstalled and the error was gone.

  • Error in running custom tag

    Hi
    I am new in jsp?s custom tag development and trying to run it's example with jakarta-tomcat-4.1.30. I have hello.jsp
    <%@ taglib uri="/WEB-INF/mytaglib.tld" prefix="first" %>
    <HTML>
    <HEAD> <TITLE>hELLO tAG</TITLE></HEAD>
    <BODY bgcolor="#ffffcc"><B>My first tag prints</B>
    <first:hello/></HTML>
    and mytaglib.tld as
    <?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.2</jspversion>
    <shortname></shortname>
    <uri></uri>
    <info>A simple tag library for the example</info>
    <tag>
    <name>hello</name>
    <tagclass>HelloTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info></info>
    </tag>
    </taglib>
    and HelloTag.java as
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.PageContext;
    import javax.servlet.jsp.tagext.Tag;
    public class HelloTag implements Tag {
         private PageContext pageContext;
         private Tag parent;
         public HelloTag() {
              super();     }
         public void setPageContext(PageContext arg0) {
              this.pageContext = arg0;}
         public void setParent(Tag arg0) {
              this.parent = arg0;}
         public Tag getParent() {
              return parent;}
         public int doStartTag() throws JspException {
              try{
                   pageContext.getOut().print("This is my first Tag");
              }catch(Exception e){throw new JspException("Error);}
              return SKIP_PAGE;     }
         public int doEndTag() throws JspException {
              return SKIP_PAGE;}
         public void release() {     }
    I am getting following error
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /hello.jsp(7,0) Unable to load class hello
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219)
         at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:712)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:804)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    Can anyone help me in running this example.

    an uri is not an url,
    in your web.xml you should have something like
    <taglib>
    <taglib-uri>http://yourtaglib/taglib</taglib-uri>
    <taglib-location>/WEB-INF/yourtaglibtld</taglib-location>
    </taglib>
    that uri should be same as in the tld.file and same as in the <%@ taglib tag

  • HTTP 500 Internel server error in Custom tag program on Weblogic 8.1

    Dear sir,
    Please attend my problem...
    I face the Error 500 Internel server error when I rum the custom tag program on weblogic 8.1.
    My program Structure is:
    Program>Home.jsp
    >WEB-INF>classes>mypack>MyTag.java, MyTag.class
    >tlds>taglib.tld
    >web.xml
    Home.jsp:
    <%@ taglib uri="/WEB-INF/tlds/taglib" prefix="Kumar" %>
    <Kumar:hello name="Vijay">
    It is a Tag Body<br>
    </neeraj:hello>
    taglib.tld:
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <uri>/WEB-INF/tlds/taglib</uri>
    <tag>
    <name>hello</name>
    <tag-class>mypack.MyTag</tag-class>
    <attribute>
    <name>name</name>
    <required>true</required>
    </attribute>
    </tag>
    </taglib>
    MyTag.java:
    package mypack;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class MyTag extends TagSupport
    String name;
    public void setName(String c)
    name=c;
    public int doStartTag()
    return EVAL_BODY_INCLUDE;
    public int doEndTag()
    try
    JspWriter out=pageContext.getOut();
    out.print("Good Night "+name);
    catch(Exception e)
    return EVAL_PAGE;
    web.xml:
    <web-app>
    <welcome-file-list>
    <welcome-file>/Home.jsp</welcome-file>
    </welcome-file-list>
    <taglib>
    <taglib-uri>/WEB-INF/tlds/taglib</taglib-uri>
    <taglib-location>/WEB-INF/tlds/taglib.tld</taglib-location>
    </taglib>
    </web-app>
    Allthough this program are run on NetBean6.1.In NetBean6.1, i am not specify the web.xml file.Please Help me..

    With an [HTTP status code|http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html] of 500, the most helpful information for debugging the problem is usually in the server's log file. There should be a stack trace in the web or application server's log file that will contain the specific root cause of this. It is often a NullPointerException or ClassNotFoundException or other "common" exception.

  • Custom tag 'process'  error

    << runtime failure in custom tag 'process' >>>
    Trying to create a simple portlet but it keeps giving the following stack
    trace.
    Any clues ?
    TIA
    javax.servlet.ServletException: runtime failure in custom tag 'process'
    at
    jsp._portals._repository.__user_add_portlets._jspService(__user_add_portlets
    .java:871)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :106)
    at
    weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
    l.java:154)
    at
    com.beasys.commerce.foundation.flow.ServletDestinationHandler.handleDestinat
    ion(ServletDestinationHandler.java:51)
    at
    com.beasys.commerce.foundation.flow.FlowManager.service(FlowManager.java:448
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :106)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:907)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:851)
    at
    weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java:252)
    at
    weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:364)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)

    There are a number possible reasons for the error "runtime failure in custom tag
    'process'" for WLCS 3.11 and 3.2. You might check the following:
    1) Make sure that WebLogic Server 5.10 SP6 is installed correctly and that
    weblogic510sp6.jar and weblogic510sp6boot.jar are at the fronts of
    weblogic_classpath and java_classpath, respectively.
    2) Check to see if weblogic-tags-510.jar from WebLogic Server 5.10 SP6 is copied
    to %weblogic_home%\lib\weblogic-tags-510.jar.
    3) The WLPS database is corrupted for reason or another. Rerun the appropriate
    database script at \weblogiccommerce\db\cloudscape\create-all-cloudscape.bat or
    \weblogiccommerce\db\oracle\create-all-oracle.sql.
    Ted
    aamerG wrote:
    << runtime failure in custom tag 'process' >>>
    Trying to create a simple portlet but it keeps giving the following stack
    trace.
    Any clues ?
    TIA
    javax.servlet.ServletException: runtime failure in custom tag 'process'
    at
    jsp._portals._repository.__user_add_portlets._jspService(__user_add_portlets
    .java:871)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :106)
    at
    weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
    l.java:154)
    at
    com.beasys.commerce.foundation.flow.ServletDestinationHandler.handleDestinat
    ion(ServletDestinationHandler.java:51)
    at
    com.beasys.commerce.foundation.flow.FlowManager.service(FlowManager.java:448
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :106)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:907)
    at
    weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:851)
    at
    weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java:252)
    at
    weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:364)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)

  • Custom tag: Compilation error

    I created a simple class for a simple custom tag. Whenever, I tried to compile, I got this error message:
    package javax.servlet.jsp.tagext does not exist
    Here's what I did:
    javac -classpath c:\jakarta-tomcat-5.5.9\common\lib\servlet-api.jar com\app\mytags\errorTag.java
    I'm using J2SE 5.0 SDK and Tomcat 5.5.9. In addition, I also included the servlet-api.jar in classpath.
    Thanks so much,
    Raja

    Here's what I did:
    javac -classpath
    c:\jakarta-tomcat-5.5.9\common\lib\servlet-api.jar
    com\app\mytags\errorTag.javaUnless you have put com/app/mytags/errorTag.java into that jar file, that isn't what you did. If you did, the compiler would complain that it couldn't find errorTag.java. Because you don't have a classpath entry where it might be.

  • Tiles + JSF error (Illegal to flush within a custom tag)

    Hi,
    When I try to use Tiles + JSF I have this error message :
    javax.servlet.jsp.JspException: Illegal to flush within a custom tag
    I am already using flush="false" on my tiles:insert tag.
    This is my .jsp code :
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <tiles:insert beanName="cadastro_base" beanScope="request" flush="false">
    <tiles:put name="form_body" type="string">
    <f:view>
    <h:form id="DisciplinaJsfBean" binding="#{DisciplinaJsfBean.form}" >
    <h:inputText id="codigo" binding="#{DisciplinaJsfBean.itCodigo}"/>
    </h:form>
    </f:view>
    </tiles:put>
    </tiles:insert>
    And this is the stack trace message :
    exception
    javax.servlet.ServletException: Illegal to flush within a custom tag
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:99)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    root cause
    javax.servlet.jsp.JspException: Illegal to flush within a custom tag
         com.sun.faces.taglib.jsf_core.ViewTag.doEndTag(ViewTag.java:223)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_f_view_0(cadastrarDisciplinas_jsp.java:205)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_put_0(cadastrarDisciplinas_jsp.java:157)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_insert_0(cadastrarDisciplinas_jsp.java:122)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    Danilo.

    What worked for me was to add a flush="false" to each of the <tiles:insert tags in my layout page.
    I'm using this with JSF so it may be different for you:
    ... Layout stuff ...
       <tiles:insert attribute="body" flush="false" />
    ... More layout stuff, including more inserts with the flush="false" ....

  • Error in JSP Custom Tag Program

    Hi Dear,
    when I compile my JSP Custom tag program on weblogic Its give that Error..
    Parsing of JSP File '/Home.jsp' failed: /Home.jsp(-1): cannot load TLD: weblogic.xml.dom.ChildCountException: missing child tagclass in tag
    probably occurred due to an error in /Home.jsp line -1:
    Tue Sep 09 18:46:56 GMT 2008
    My Files are:
    Home.jsp:
    <%@ taglib uri="/WEB-INF/tlds/taglib.tld" prefix="neeraj" %>
    <neeraj:hello name="Vijay">
    It is a Tag Body<br>
    </neeraj:hello>
    taglib.tld:
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <uri>WEB-INF/tlds/taglib.tld</uri>
    <tag>
    <name>hello</name>
    <tag-class>mypack.MyTag</tag-class>
    <attribute>
    <name>name</name>
    <required>true</required>
    </attribute>
    </tag>
    </taglib>
    MyTag.java:
    package mypack;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class MyTag extends TagSupport
    String name;
    public void setName(String c)
    try
    name=c;
    catch(Exception e)
    count=1;
    public int doStartTag()
    return EVAL_BODY_INCLUDE;
    public int doAfterBody
    JspWriter out=pageContext.getOut();
    out.print("Good Night "+name);
    catch(Exception e)
    return EVAL_PAGE;
    web.xml:
    <web-app>
    <welcome-file-list>
    <welcome-file>/Home.jsp</welcome-file>
    </welcome-file-list>
    <taglib>
    <taglib-uri>taglib</taglib-uri>
    <taglib-location>/WEB-INF/tlds/taglib.tld</taglib-location>
    </taglib>
    </web-app>
    Please resolve my issue..

    I had the same problem. In your .tld change tagclass to tag-class and bodycontent to body-content and that should do the trick. The names slightly changed for JSP spec 1.2.
              

  • Custom Tag Library - error in IWS

    My environment: Solaris 2.7, IWS4.1 SP3.
    I currently try to run the Custom Tag Library example from IWS itself in
    server_root/plugins/samples/servlets/taglibs. I follow the instructions to
    config the IWS but fail to run the example. I turn on JSP debugging and
    find the following error messages:
    [12/Oct/2000:13:03:10] info (28609): Service(): uri=/jsps/test-tags.jsp
    cgiScriptName=/jsps/test-tags.jsp token=null cached=false
    [12/Oct/2000:13:03:10] info (28609): Internal Info: loading servlet
    /jsps/test-tags.jsp
    [12/Oct/2000:13:03:10] info (28609): JSP: This is a jsp 1.x file
    [12/Oct/2000:13:03:10] info (28609): JSP: Before JSP1x compiler.compile,
    servletName = /jsps/test-tags.jsp servletPath =
    /u01/devin/docs/jsps/test-tags.jsp & dir = ../ClassCache
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace: Package name is:
    jsps.jsps
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace: Class name is:
    test0002dtags_jsp
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace: Java file name is:
    /opt/netscape/server4/https-devin/config/../ClassCache/_jsps/_jsps/_test_000
    2dtags_jsp.java
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace: Class file name is:
    /opt/netscape/server4/https-devin/config/../ClassCache/_jsps/_jsps/_test_000
    2dtags_jsp.class
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace:
    Handling Directive: page {language=java}
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace: Accepted
    org.apache.jasper.compiler.Parser$Directive at /jsps/test-tags.jsp(0,0)
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace:
    Handling Directive: taglib {uri=/jsps/test-tags.jar, prefix=tt}
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace: Copying
    /jsps/test-tags.jar into
    /opt/netscape/server4/https-devin/config/../ClassCache//jsps/test-tags.jar
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace: Adding jar
    /opt/netscape/server4/https-devin/config/../ClassCache//jsps/test-tags.jar
    to my classpath
    [12/Oct/2000:13:03:10] info (28609): Aborting JVM
    [12/Oct/2000:13:03:10] info (28609): Exiting JVM due to: jvm_abort () and
    jvm.exitOnAbort > 0
    [12/Oct/2000:13:03:10] info (28609): JVM exit statistics:
    AttachedThreads/Max=1/1, ActiveThreads/Max=1/1
    [12/Oct/2000:13:03:11] info (28716): Initializing MMapSession Manager to
    hold a maximum of (1000) sessions, each of which can store a maximum of
    (100) values and no value size bigger than (1024) bytes, with a timeout
    value of (1800) seconds
    IWS keeps aborting JVM and one can see from the log that it abort jvm when
    trying to :
    [12/Oct/2000:13:03:10] info (28609): JSP1x Jasper Trace: Adding jar
    /opt/netscape/server4/https-devin/config/../ClassCache//jsps/test-tags.jar
    to my classpath
    [12/Oct/2000:13:03:10] info (28609): Aborting JVM
    I have tried another much simple Custome Tag Library example that only contain a simple tag that do output to page, but still getting the same error.

    I had the same issue with WAS 6.1.0.2. I do not have a solution, but a workaround. I hope the workaround I have works for you too.
    In my case, I have the TLD files deployed in a jar. So, the JSP 2.0 container is supposed to read those TLD files from the jar file. Since that was not happening, I extracted the TLD file from the jar file and placed it under my web project's WEB-INF folder.
    I restarted my server and after that it worked.
    Look at the IBM site to see if they have come up with a patch for WAS 6.0.
    Hope this helps.
    -Javier

  • Custom tag - unable to find setter method error

    I see this compileException on IAS but not on BEA app server and iWS.
    JSPProvider.processJSPFile(): jsp=searchContent.jsp, org.apache.jasper.compiler.CompileException
    Unable to find setter method for attribute: input
    The reason is because the custom tag has a setInput() that takes a String parameter while the getInput() returns an InputStream.
    Should both get and set methods have the same type of parameters or is this a due to a bug in the app server ?

    I see this compileException on IAS but not on BEA app
    server and iWS.
    JSPProvider.processJSPFile(): jsp=searchContent.jsp,
    org.apache.jasper.compiler.CompileException
    Unable to find setter method for attribute: input
    The reason is because the custom tag has a setInput()
    that takes a String parameter while the getInput()
    returns an InputStream.
    Should both get and set methods have the same type of
    parameters or is this a due to a bug in the app server
    I was only going off info from the original post. The error specifically states "Unable to find setter method for attribute: input" with a lower case i for the input attribute. You also specifcally stated "The reason is because the custom tag has a setInput()" with a capital I for the setInput method. This would most definitely cause the error you were receiving. That is unless you corrected this between your original post and your followup testing.
    Cliff

  • Error Using Custom Tag

    I am trying to use a custom tag but receive an error when I use it on a jsp page.
    I have a tag handler class file, tag library descriptor file, specified the path to the .tld in the web.xml file.
    The error implies that it cannot find the SimpleTag.class file, though I put it in the \webapps\examples\WEB-INF\classes\ directory.
    Here is the error. Does anyone know what else it could be?
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    C:\jakarta-tomcat-4.0.1\work\localhost\examples\jsp\jspVisual\ch10\using_0005ftag$jsp.java:63: Class org.apache.SimpleTag not found.
    SimpleTag_jspx_th_myFirstTag_SimpleTag_0 = new SimpleTag();

    I could not see any obvious mistakes. But what you could try, in order to isolate the problem, is to bypass the web.xml. In other words access the TLD directly by doing this in your JSP
    <%@ taglib uri="/WEB-INF/jsp/tag_library_descriptor.tld" prefix="myFirstTag" %>
    if that does work then move the your TLD out of the jsp folder and into WEB-INF , then try
    <%@ taglib uri="/WEB-INF/tag_library_descriptor.tld" prefix="myFirstTag" %>
    Maybe someone else has better idea.

  • Jsp/custom tag compiler error (HttpServletResponse)

    I originally posted with on Oracle's site but I am not getting any help.
    Our server is running Oracle 9ias with JServ and Apache.
    I have created a simple jsp that calls a custom tag but I am getting the following error:
    Method addHeader(java.lang.String, java.lang.String) not found in interface javax.servlet.http.HttpServletResponse.
    response.addHeader("Pragma", "No-cache");
    ^
    Is something not setup correctly or installed where it should be?
    the code for the custom tag is from the O'reilly book "JavaServer Pages." This works with JDeveloper on my computer but not on our server.
    package info.wyoroad.jsp.tags.generic;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * This class is a custom action for setting response headers
    * that prevent the page from being cached by a browser or
    * proxy server.
    * @author Hans Bergsten, Gefion software <[email protected]>
    * @version 1.0
    public class NoCacheTag extends TagSupport {
    * Sets "no cache" response headers
    public int doEndTag() throws JspException {
    HttpServletResponse response =
    (HttpServletResponse) pageContext.getResponse();
    response.addHeader("Pragma", "No-cache");
    response.addHeader("Cache-Control", "no-cache");
    response.addDateHeader("Expires", 1);
    return EVAL_PAGE;
    }

    The jsp looks like:
    <%@ page language="java" contentType="text/html;charset=WINDOWS-1252"%>
    <%@ taglib uri="/WEB-INF/wylib.tld" prefix="info" %>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=WINDOWS-1252">
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <info:NoCache />
    <TITLE>
    Test tag
    </TITLE>
    </HEAD>
    <BODY>
    <H2>Test the tag NoCache</h2> </P>
    </BODY>
    </HTML>

  • Custom Tag - Strange Error!!!

    Hi All,
    I've a custom tag.. and inside that I simply wrote up one
    select query and following that I put one condition like this,
    <cfif #qryCustomerSelect.cust_category# neq 5>
    //Statements..
    </cfif>
    And I am getting one strange error stating
    "qryCustomerSelec.cust_categoryt" is undefined... I tried dumping
    the query and it worked well..
    What I am doing wrong here?...
    Any help is greatly appreciated...
    Thanks

    take away the octothorps and specify a row number.

Maybe you are looking for

  • How to log just plain text but not xml while using util.logging?

    i tried the following code to log simple messages in my app.However it logs the messages in xml. I don't want this and only plain text will be enough so what should i do? e.g. using some formatters? import java.util.logging.*; class LoggerTest{      

  • Tables related to Costing module

    Hi What are the tables related to the tcode s_alr_87013611 with respect to time and HRS taken

  • Conditionally display report in a tab

    Hi, I am building an application that has 3 tabs (Main,Header,Details). I am new to apex and learning things. Main page has 4 regions where each region has a chart. When user clicks on these charts it should drill to an interactive report on 'Header'

  • 8500 all in one

    8500 all in one has engineering defects in both paper tray senors... fax and paper tray.  new one did not work. they sent us a refurb replacement - it does not work... and HP cannot fix on ph. wee need  same dpi and other charcteristics. WHICH ONE...

  • Your file could not be printed due to an error...

    Hi All, I have users with a Windows XP client running Office 2003 with the 2007 compatibility pack installed.  The printer is an HP OfficeJet 6500 709a.  The user has not experienced any problems printing in the past, and can still print everything e