Custom tag in JSP

MyTag currently extends from TagSupport. But still it complains this at runtime:
          weblogic.servlet.jsp.JspException: (line -1): Error in tag library at: 'my': er
          ror introspecting class: 'MyTag':
          weblogic.servlet.jsp.JspException: (line -1): Error in tag library at: 'my': cl
          ass MyTag doesn't implement javax.
          servlet.jsp.tagext.Tag
          at weblogic.servlet.jsp.StandardTagLib.jspException(StandardTagLib.java:
          138)
          at weblogic.servlet.jsp.StandardTagLib.processTag(StandardTagLib.java:24
          4)
          at weblogic.servlet.jsp.StandardTagLib.processTagElements(StandardTagLib
          .java:146)
          at weblogic.servlet.jsp.StandardTagLib.<init>(StandardTagLib.java:125)
          at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:87)
          at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java:38
          11)
          at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:3561)
          at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:3422)
          at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1760)
          

yeah you should this is how you need to configure your web.xml
<jsp-config>
            <taglib>
                 <taglib-uri>mycustomtag</taglib-uri>
                <taglib-location>/WEB-INF/tld/DemoTags.tld</taglib-location>
            </taglib>
</jsp-config>and at jsp level you can access it as
<%@ taglib uri="mycustomtag" prefix="mytag" %>
<mytag:property ..... />Hope that might help :)
REGARDS,
RaHuL

Similar Messages

  • How to use custom tag in jsp

    sir
    plz tell me how to use custom tag in jsp.plz describe it.
    i will be thankful to u

    Do you want to use taglibs or develop custom tags? Either way take a look at these:
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
    http://www.stardeveloper.com/articles/display.html?article=2001081301&page=1
    http://www.onjava.com/pub/a/onjava/2000/12/15/jsp_custom_tags.html
    http://jakarta.apache.org/taglibs/tutorial.html
    http://www.ibm.com/developerworks/edu/j-dw-java-custom-i.html
    http://www.herongyang.com/jsp/tag.html

  • Urgent-how to access custom tag from jsp tag

    I have a problem accessing a custom tag from a jsp expression.
    Details: I have a custom tag that returns a string variable. I need to access that variable from jsp expression <%%>.
    Can any body help me?

    Tags don't "return" values as in the normal sense.
    They can only support TEI (Tag Extra Information) that just stuffs a declared variable into the page's state.
    For example, if the tag class had a public method called getValue(), you could do the following:
    <xmp:mytag id="foo"/>
    <%
    out.println("value is " + foo.getValue());
    %>

  • Passing params to custom tag from jsp

    Hi all, I have a problem passing params back to my custom tag. The tag handler has a "getPageNumber()" method which returns a value. Initially the value is set and if a link is clicked it passes that param to the tag handler. I am trying to get this value from the tag handler to update the value on the link parameter.
    Something like this:
    // processed tag
    <a href="mypage.jsp?page=1">Next page</a>
    // clicking "Next Page"
    <a href="mypage.jsp?page=2">Next page</a>
    // jsp
    <taglib:tag param="<%=getPageNumber()%>"  />
    // in tag lib
    private pagenumber=1;
                pagenumber++;
    getPageNumber(){
    return pagenumber;
    setPageNumber(int pagenumber){
       this.pagenumber=pagenumber
    }I'm not sure if this is the best way to do this or if what I am trying to do is even possible.
    Any advice would be greatly appreciated.
    Thanks :)

    Hi all, I have a problem passing params back to my custom tag. The tag handler has a "getPageNumber()" method which returns a value. Initially the value is set and if a link is clicked it passes that param to the tag handler. I am trying to get this value from the tag handler to update the value on the link parameter.
    Something like this:
    // processed tag
    <a href="mypage.jsp?page=1">Next page</a>
    // clicking "Next Page"
    <a href="mypage.jsp?page=2">Next page</a>
    // jsp
    <taglib:tag param="<%=getPageNumber()%>"  />
    // in tag lib
    private pagenumber=1;
                pagenumber++;
    getPageNumber(){
    return pagenumber;
    setPageNumber(int pagenumber){
       this.pagenumber=pagenumber
    }I'm not sure if this is the best way to do this or if what I am trying to do is even possible.
    Any advice would be greatly appreciated.
    Thanks :)

  • Calling jsp custom tag from jsp expression

    hi there,
    I have a problem calling oracle(or any other) custom tag from inside a jsp expression.(i.e.)embeding <jbo:tagname...> into <%......%>.
    For example:
    I need to get the value of a jsp parameter, but the parameter name is dynamic (retrieved from a DataBase)
    So I though it would be something link that:
    <%=request.getParameter(<jbo:ShowValue datasource="ds" dataitem="ParamName" ></jbo:ShowValue>) %>
    where <jbo:ShowValue is an Oracle custom tab that retrieves the value of a certain dataItem(certain field).
    But it does not work.........
    if any body can tell me how to overcome, or work around it, I'll be so pleased.
    Regards,
    Remoun Anwar

    Hi,
    You get the custom tag output into a hidden variable (say 'key') and use the request.getParameter("key")
    Hope u got the answer...
    Regards
    ravi

  • Custom Tags in JSP

    I am new to using custom tags. Is there a nice book or site which I could read on custom tags.
    Also, I kind of understand custom tags but not completely confident.
    I have a JSP that uses two custom tags, flight and segment. Basically, goes through each segment with flight tag and prints out attribute of segment with Segment tag. The code looks like this.
    <flifo:flight isParent="true" fromParent="true" >
              <td bgcolor="<%=bgcolor%>" width="94" valign="top" class="t7">
                        <%-- Print FLIGHT NUMBER --%>
                   Flight
                        <b><flifo:segment fromParent="true" attribute="flight_num" /></b>
                        <br>
    </flifo:flight>
    In the above code I just have flight_num but there are other attributes that it prints out. I want to check an attribute in segment and if it is ture then display some of the tags. How can I do it?

    This has helped me a lot in the past:
    http://java.sun.com/developer/Books/javaserverpages/cservletsjsp/chapter14.pdf
    ... and the book it's extracted from is very good too.

  • Custom tag and JSP = getOutputStream error

    Hi guys. I have a custom authorization tag as follows:
    package tags;
    import stuff;
    public class AuthenticatedTag extends TagSupport {
         public int doStartTag() throws JspException {
              try {
                   pageContext.forward("login.htm");
              } catch (Exception e) {
                   e.printStackTrace();
              return EVAL_PAGE;
         public int doEndTag() throws JspException {
              return EVAL_PAGE;
    }and a jsp page using this tag:
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" errorPage="error.jsp" %>
    <%@ taglib uri="/WEB-INF/tags.tld" prefix="tags" %>
    <tags:myauth />
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>stuff
    </body>
    </html>When I point my browser to this jsp I get:
    org.apache.jasper.JasperException: getOutputStream() has already been called for this response
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:383)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    Any ideas of what could be wrong? thx

    If you forward to the login.htm page, you should stop the rest of the current page evaluating. Just because you forwarded it, doesn't stop the flow of control in this page. It is trying to evaluate both the current page and the one that you forwarded to. You can only send one response
    Returning SKIP_PAGE from the doEndTag function should do the trick.
    I'm not sure that returning EVAL_PAGE or SKIP_PAGE from the doStartTag is legal. It should return SKIP_BODY or one of the EVAL_BODY options.
    In fact I think the whole thing should probably be done in the doEndTag for that reason.
    package tags;
    import stuff;
    public class AuthenticatedTag extends TagSupport {
         public int doEndTag() throws JspException {
              try {
                   pageContext.forward("login.htm");
                            return SKIP_PAGE
              } catch (Exception e) {
                   e.printStackTrace();
              return EVAL_PAGE;
    }I presume you will be putting in some sort of check to see if you should forward to login.html instead of evaluating the current page?
    Just as an alternative suggestion, a better way IMO is to implement this sort of logic as a filter, rather than putting a tag on a JSP page.
    Cheers,
    evnafets

  • Problem using Custom tag in JSP

    Iam facing problem when i am deploying my files on j2ee 1.4 server it give following erroer::
    my .tld file and jsp are given below
    any body can help me;
    mytaglib.tld file:
    <<?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 tag library descriptor -->
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>first</shortname>
    <uri></uri>
    <info>A simple tab library for the
    examples</info>
    <tag>
    <name>hello</name>
    <tagclass>tags.HelloTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info>Say Hi</info>
    </tag>
    </taglib>
    MY JSP file :::
    <%@ 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/>
    </BODY>
    </HTML>
    Error :::
    org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/mytaglib.tld: (line 1, col 2)
         org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:218)
         org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:188)
         org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:515)
         org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:460)
         org.apache.jasper.compiler.Parser.parseDirective(Parser.java:526)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1617)
         org.apache.jasper.compiler.Parser.parse(Parser.java:174)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:244)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:146)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:132)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:245)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:462)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:448)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:551)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:300)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:324)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:284)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200)

    thanks for reply it still giving error :
    org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/mytaglib.tld
         org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:218)
         org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:188)
         org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:515)
         org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:460)
         org.apache.jasper.compiler.Parser.parseDirective(Parser.java:526)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1617)
         org.apache.jasper.compiler.Parser.parse(Parser.java:174)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:244)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:146)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:132)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:245)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:462)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:448)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:551)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:300)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:324)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:284)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:306)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:200)

  • Calling custom tags in jsp  with jsp:include

    Hi,
    I have a large jsp file , which uses jstl fmt tags for labels.
    Since the size of jsp was too big iand i was unable to compile it because of 64 kb class size limit,
    I removed the tag lib defination from the jsp file and put it in another jsp file. and used jsp:include to include this file inside the first jsp.
    It is compiling successfully but labels r not showing up.
    but when i use <%@include to include second jsp in the first one i get the labels properly.
    I cannot use <%@include as this starts giving me compilation error related with jsp class file size beyond 64 kb.
    Pls suggest why jsp:include is not working.
    thanks,
    Pramod

    Hi Anil,
    Ur suggestion was good but could not solve my problem.
    I have put a small sample code to illustrate the problem.
    labeldemo.jsp:
    <%-- <%@ include file="WDCComInitLabelsjunk.jsp" %> --%>
    <jsp:include page="WDCComInitLabelsjunk.jsp" flush="true" />
    <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tablebg">
                                  <tr class="headtd">
                                       <td colspan="4"><span class="headtext"><fmt:message key="Cash_Management"/> </td>
                                  </tr>
                                  <tr> hi </tr>
                             </table>
                             </fmt:bundle>
    WDCComInitLabelsjunk.jsp:
    <%@ page language="java" %>
    <%@ page contentType="text/html"%>
    <%@ page import="com.tcs.wdc.core.*" %>
    <%@ page import="com.tcs.wdc.core.login.*" %>
    <%@ page import="com.tcs.wdc.core.service.navigation.*" %>
    <%-- Include tag library --%>
    <%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
    <%-- Get language from IDCUserSession & set it in session --%>
    <%
    /*SessionManager sm = new SessionManager(session);
    IDCUserSession ius = sm.getIDCUserSession();*/
    session.setAttribute("language","nl_NL");
    %>
    <%-- Set the locale for the language obtained --%>
    <fmt:setLocale value="${language}" />
    <fmt:bundle basename="labels" />
    If i uncomment the <%@ include file="WDCComInitLabelsjunk.jsp" %> tag in the code above it is working fine ,
    but it is not working with <jsp:include page="WDCComInitLabelsjunk.jsp" flush="true" />
    pls suggest.
    Thanks,
    Pramod

  • Custom tags in jsp - problems with import in java pgm

    Hi,
    I am new to JSP and am facing some problems.
    I am trying to compile the foll. java program and it is giving an error saying 1."Package javax.servlet.jsp does not exist", 2."Package javax.servlet.jsp.tagext does not exist".
    I am using 1.j2sdk1.4.1_02, 2.j2sdkee1.3.1,and 3.Tomcat 4.1
    My java_home=C:\j2sdk1.4.1_02
    j2ee_home=C:\j2sdkee1.3.1
    path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\j2sdkee1.3.1\bin;c:\j2sdk1.4.1_02\bin;c:\j2sdkee1.3.1\doc\api;c:\jakarta-ant-1.5.1\bin
    classpath=c:\j2sdkee1.3.1\bin;c:\j2sdk1.4.1_02\bin;c:\j2sdkee1.3.1\doc\api
    can anybody help me with it?
    Regards,
    newtojsp
    import java.io.IOException;
    import java.util.Date;
    import doc.api.javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class TestTag extends TagSupport
         public int doStartTag () throws JSPTagException
              String dateString = new Date().toString ();
              try
                   JspWriter out = page.context.getOut ();
                   out.println ("Welcome to the Loan Dept" + " <br>");
                   out.println ("Today is:" + dateString + "<br>");
                   return SKIP_BODY;
              } catch (IOException ee)
                   throw JspTagException ("Error Encountered");
         public int doEndTag () throws JSPTagException
              return EVAL_PAGE;

    I got the solution for this.
    Thanks
    Newtojsp

  • The J2EE Tutorial (Chap 15-Custom Tags in JSP pages

    The definition class "DefinitionTag" talks about putting the definition instance of "Definition" class in a page context, using the following code
    // put the definition in the page context
    context.setAttribute(definitionName, definition,
    context.APPLICATION_SCOPE);
    Now in an application where the request dispatcher servlet is forwarding the request to this template.jsp. What is the impact when we are using the same application scope variable "definitionName = bank� for all the http request(s) (multi pages /multi users). I am interested to know whether this approach is scalable or will it create a performance bottleneck when the definition scope is application level. I will appreciate any feedbacks.
    Regards,
    Jayesh
    MCSE, MSCD, SCJP, PMP, IBM WAS ADM

    I got the solution for this.
    Thanks
    Newtojsp

  • JSP Custom Tags, Tag Handlers, Passing values

    Multiple questions here while I try to work with custom tags (its a requirement):
    From what I have had so far - I have a .tld file, a .java file and a .jsp page.
    (this is not a working version as I just got it from a website)
    platform: tomcat on an xp box.
    I was wondering if we can pass the parameters that are passed to the the jsp page (like blah.jsp?param1=value1&param2=valu2 ) to the tag handler?
    This is because the processing that I need to do in the handler would depend on what I have in the passed values.
    Any help in letting me know where to place those files on the tomcat context root would help. Please see, I do have a couple of servlets running on the box also and they might be in the same context root.
    Any good short tutorial link is also welcome as a short answer as I try to unravel the custom tags in jsp.

    I am using TomCat 5.5
    What I need to do using tags is to build a web-page on the fly by polling a couple of different tables in the database.
    This is to be done using a jsp and custom tag (requirement) which would be able to handle any resultsets. We also have to come up with pageContext attribute names and supply column names as those attributes. Thus we will have to come up with the meta data file and a tag library descriptor as well.
    I found a helloworld solution on a website and was trying to modify it to meet my needs. But I guess I under-estimated the work that needed to be done in this one.

  • Jsp:include problem in custom tag

    I call <jsp:include page="emailbody.jsp" /> within a custom tag(in a file
              caller.jsp), which does emailing.
              When I invoke caller.jsp from browser, I do get the output(body of the
              email) on the browser screen, but not the output is not send as the body of
              the email.
              When I use static include namely, <@include file="emailbody.jsp" />, the
              output is directed to the body of the email.
              The above means, for a static jsp include file, it is parsed and included in
              the body-evaluation of the custom tag.
              For a dynamic include file, it is NOT parsed and NOT included in the
              body-evaluation of the custome tag.
              The reason could be, How Weblogic loads classes for custom-tag for dynamic
              include files.
              Can anybody at BEA throw loght on this and the solution.
              Thanks in advance.
              Chandra
              

    Well I found out jsp:include is not supported inside custom tags for JSP
              spec 1.1.
              This was stated in section 5.4.5 of spec 1.1.
              May be in future spec 1.2.
              Thanks
              Chandra
              "Cameron Purdy" <[email protected]> wrote in message
              news:[email protected]...
              > Have you sent this to [email protected]?
              >
              > It sounds serious.
              >
              > Peace,
              >
              > --
              > Cameron Purdy
              > Tangosol, Inc.
              > http://www.tangosol.com
              > +1.617.623.5782
              > WebLogic Consulting Available
              >
              >
              > "matthew mcclain" <[email protected]> wrote in message
              > news:[email protected]...
              > > I have run into the same problem.
              > > I'm certain it's because CustomTags have their own buffer and
              > > jsp:include or pageContext.include() or requestDispatcher.include()
              > > all bypass the buffer and write to the underlying stream.
              > >
              > > I attempted to define jspx:include by wrapping the response object
              > > which is sent to requestDispatcher.include and then wrapping the
              > > OutputStream returned from the response with a stream which
              > > writes to the "out" of the pageContext for my tag.
              > >
              > > Unfortunately, I get a class cast exception because weblogic expects
              > > it's own class to be there as a ServletOutputStream:
              > >
              > > java.lang.ClassCastException:
              com.allmystuff.wif.IncludeServletResponse$1
              > > at
              > >
              >
              weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
              > > l.java:202)
              > > at
              > >
              >
              weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
              > > l.java:172)
              > > at com.allmystuff.wif.Include.doStartTag(Include.java:37)
              > >
              > > So any chance, jsp:include will get fixed?
              > >
              > > Thanks,
              > > Matthew McClain
              > > [email protected]
              > >
              > >
              > > "chandra" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > I call <jsp:include page="emailbody.jsp" /> within a custom tag(in a
              > file
              > > > caller.jsp), which does emailing.
              > > > When I invoke caller.jsp from browser, I do get the output(body of the
              > > > email) on the browser screen, but not the output is not send as the
              body
              > > of
              > > > the email.
              > > > When I use static include namely, <@include file="emailbody.jsp" />,
              the
              > > > output is directed to the body of the email.
              > > >
              > > > The above means, for a static jsp include file, it is parsed and
              > included
              > > in
              > > > the body-evaluation of the custom tag.
              > > > For a dynamic include file, it is NOT parsed and NOT included in the
              > > > body-evaluation of the custome tag.
              > > > The reason could be, How Weblogic loads classes for custom-tag for
              > dynamic
              > > > include files.
              > > > Can anybody at BEA throw loght on this and the solution.
              > > > Thanks in advance.
              > > > Chandra
              > > >
              > > >
              > >
              > >
              >
              >
              

  • Nested custom tag-jsp

    Hi,
    How can I use nested custom tags in jsp?

    Note that not all custom tags will work like this. The tag must be designed to work this way. Some tags will not accept a body, others will accept a body, but will not process it through the JSP compiler, rather handling it as text/html.
    Have you tried nesting them and you're not getting the expected results? Have you written these tags yourself and they're not working?

  • Custom tags prob

    Hi,
    I have created a prog using Custom Tags. I have compiled it . But when I try to run it I am getting Not found error with JSP. Can somebody help me with that:
    package com.brainysoftware;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class MyCustomTag extends TagSupport {
    public int doEndTag() throws JspException {
    JspWriter out = pageContext.getOut();
    try {
    out.println("Hello from the custom tag.");
    catch (Exception e) {
    return super.doEndTag();
    & my jsp code is :
    <%@ taglib uri="/myTLD" prefix="easy"%>
    <easy:myTag/>
    Can somebody help me to run custom tag based jsp?
    Zulfi.

    My jsp is:
    <%@ taglib uri="/myTLD" prefix="easy"%>
    <easy:myTag/>
    & its path is:
    E:\Tomcat\jakarta-tomcat-5\dist\webapps\jsp-examples\jsp2\el
    tag.tld file is:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <shortname></shortname>
    <tag>
    <name>myTag</name>
    <tagclass>com.brainysoftware.MyCustomTag</tagclass>
    </tag>
    </taglib>
    Path of MyCustomtag.tld is:
    E:\Tomcat\jakarta-tomcat-5\dist\webapps\jsp-examples\WEB-INF
    Path of web.xml is:
    E:\Tomcat\jakarta-tomcat-5\dist\webapps\jsp-examples\WEB-INF
    & my web.xml (portion of tld )is:
    <taglib> <taglib-uri>/myTLD</taglib-uri> <taglib-location>/WEB-INF/taglib.tld</taglib-location></taglib>
    Path ofMyCustomtag.class
    E:\Tomcat\jakarta-tomcat-5\dist\webapps\jsp-examples\WEB-INF\classes\com\brainysoftware
    & its source is:
    package com.brainysoftware;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class MyCustomTag extends TagSupport {
    public int doEndTag() throws JspException {
    JspWriter out = pageContext.getOut();
    try {
    out.println("Hello from the custom tag.");
    catch (Exception e) {
    return super.doEndTag();
    I am accessing it through example folder. I have to run tomcat to tell u the exact url. If the above information is not enopugh I would tell u the exact url. Plz hold sometime for that.
    Zulfi

Maybe you are looking for

  • How to add a new character set encoding?

    Hello, can anybody please explain to me, how to add a new character set encoding to Mac OS Tiger? I have two Mac laptops, a new one with Snow Leopard and an older one with Tiger, and on the old one i cannot use or enable anywhere the "Russian (DOS)"

  • Error Message When Opening Interactive Demand Planning

    Hello Experts, I have one user who is receiving the following error message when trying to open Interactive Demand Planning Workbook.  Only one user is experiencing this issue.  Has anyone run into this before?  GP: Graphics product not available in

  • I am getting erro Server error 403 on the photosmart 5520.

    I am getting erro Server error 403 on the photosmart 5520.  I tried a couple of fixed I saw on previous forum but didn't work. I tried to reset Print scan app on the printer but it's not there

  • No Sound with Premiere Elements 9

    I have done something wrong & I can't get any sound. The original source clips do have sound.  Tried everything I know –which isn't much. When I scrub the time line I can hear the chirping of voices.  The volume is turned up. I must have turned off s

  • Oracle Devloper Help

    HOW CAN I RESTRICT TO USER THROUGH ORACLE DEVELOPER FORMS THAT HE/SHE CAN OPEN ONLY ONE SESSION I THINK Win_Api_Session.One_Session MAY BE USED FOR THAT,BUT IT GIVES ERROR WHEN I TRY TO USE IT. SIMILARY Win_Api_Environment.Get_Windows_Username GIVES