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
          > > >
          > > >
          > >
          > >
          >
          >
          

Similar Messages

  • Dynamic include in a custom tag, called from a jsp

    Hello, I would like to be able to dynamically include other jsp's from within a custom tag that I create. is this possible?
    in a jsp page i would just write <%@ include file="file.jsp" %> and all would be ok... but if i do an out.println( "<%@ include file=\"file.jsp\" %>" ); inside a custom tag bean then it doesn't work. it just prints out the command to the page as plain text.
    I do understand why this is happening, but can anyone offer me a way around this problem?
    Thanks in advance,
    Randy

    That's actually the same result as you get with a normal include - The method I suggested is a dynamic include similar to the <jsp:include> tag, not the <%@ include %> tag.
    When you use a dynamic include, the included page is compiled and 'invoked' as serarately, and the result is what gets included, not the actual source. To get the behaviour you want would require an include directive (the <%@ include %> tag) which I don't think has an equivalence you can use inside a custom tag.
    What you can do is pass attributes from the tag class like this:
    pageContext.setAttribute(<name>, <object>, pageContext.REQUEST_SCOPE);
    and then remove them after the include using pageContext.removeAttribute.
    I'm not certain, but this implies that if you declare your variables with a <jsp:usebean> tag with request scope, instead of normal Java variable declarations, you should be able to use them in the page included by the custom tag.
    *** in the jsp ***
    <jsp:useBean id="myVar" scope="request" class="java.lang.String" />
    <% myVar = "Something"; %>
    // Now call the tag which uses the pageContext.include() mehtod.
    *** end ***
    *** in the include ***
    <jsp:useBean id="myVar" scope="request" class="java.lang.String" />
    <%= myVar + " something else" %>
    *** end ***
    Let me know if it works.

  • WebLogic Server 7.0: Including another JSP from within a custom tag

    Hi all,
              has anyone made experience with including (ie. processing) a dynamic
              resource (JSP) from within a custom JSP tag?
              Using the following code inside doEndTag():
              pageContext.include("/templates/blub.jsp");
              throws a ServletException (Note: the JSP is a part of the web app
              which is deployed as war). Does it make a difference if the web
              application is warred up into and therefore include cannot resolve the
              specified relative URL?
              [Tomcat 4.1.10 doesn't have problems for that matter]
              The full stack trace is:
              javax.servlet.ServletException: java.lang.NullPointerException
              at com.foo.taglibs.template.InsertTag.doEndTag(InsertTag.java:55)
              at jsp_servlet._models.__index._jspService(__index.java:774)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
              at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
              TIA,
              niko.
              

    Try the same code from an exploded web app.
              Niko Schmuck wrote:
              > Hi all,
              >
              > has anyone made experience with including (ie. processing) a dynamic
              > resource (JSP) from within a custom JSP tag?
              >
              > Using the following code inside doEndTag():
              >
              > pageContext.include("/templates/blub.jsp");
              >
              > throws a ServletException (Note: the JSP is a part of the web app
              > which is deployed as war). Does it make a difference if the web
              > application is warred up into and therefore include cannot resolve the
              > specified relative URL?
              > [Tomcat 4.1.10 doesn't have problems for that matter]
              >
              > The full stack trace is:
              >
              > javax.servlet.ServletException: java.lang.NullPointerException
              > at com.foo.taglibs.template.InsertTag.doEndTag(InsertTag.java:55)
              > at jsp_servlet._models.__index._jspService(__index.java:774)
              > at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              > at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
              > at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
              > at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
              > at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
              > at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
              >
              > TIA,
              > niko.
              Rajesh Mirchandani
              Developer Relations Engineer
              BEA Support
              

  • Problem with custom tag attribute types

    Hi,
    I try to figure out how to pass an attribute to a custom tag that is of a type other than "String"?
    In my case, I should pass an attribute with a type of "java.util.ResourceBundle".
    My tag looks like this:
    <tt:cs sel="ab" ce="<%= java.util.ResourceBundle.getBundle("de", Application.getApp().getLocale())%>" />
    I always get the message that the attribute ce is empty.
    Isn't it possible to have attirbutes that are of an other type than string? How could I solve this problem?
    Thanks a lot!
    Regards Patrick

    In JSP 1.2, in the Tag Library Descriptor, you can specify a tagt attribute as
    <attribute>
       <name>attr1</name>
       <required>true|false|yes|no</required>
       <rtexprvalue>true|false|yes|no</rtexprvalue>
       <type>fully-qualified_type</type>
    </attribute> Notice the XML element <type>fully-qualified_type</type>
    Not sure if you can do this in JSP 1.1

  • Urgent: Unable to run JSP pages(using JRun Custom Tags) in Weblogic 5.1

    Hi,
    I am using JRun Custom tags to bulid JSP pages.
    Could not run the jsp page on Weblogic 5.1.
    I could run the same on JRun Server but not on Weblogic?.
    Had placed JRuntags.jar in the web_inf directory.
    What/where i need to update in properties file?.
    Please reply..
    Best Wishes.
    Satish k.Yalamaddi.

    javax.servlet.ServletException: com/sun/tools/javac/Main (Unsupported major.minor version 49.0)
    This is your problem either your tomcat or eclipse is pointing to a wrong jre
    here the problem is you are trying to run a code that was compiled using j2sdk1.5 in j2sdk1.4

  • Problem with custom tag

    I have written a custom tag that I am having problems with. It works on some machines, but not on others. I have a page that uses many 'standard' tags. I have correctly set the URI etc, because all of my other tags work. However, on some machines, my custom tag gives me an error:
    attribute does not support request time values
    I'm assuming that I have the correct versions of standard.jar etc because all of the regular jstl 1.1 tags work. It is just my custom tag that throws an error.
    here is the .tld for my tag:
    <?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>
         <tlib-version>1.1.2</tlib-version>
         <jsp-version>1.2</jsp-version>
         <short-name>My custom tag</short-name>
         <uri>http://my.custom/tags</uri>
         <tag>
              <name>breadcrumb</name>
              <tag-class>tag.BreadcrumbTag</tag-class>
              <body-content>JSP</body-content>
              <attribute>
                   <name>breadcrumbs</name>
                   <required>true</required>
                   <rtexprvalue>false</rtexprvalue>
                   <description>Pass in the list of Breadcrumbs containing the actual information
    about what tags need to be rendered on the page.</description>
              </attribute>
         </tag>
    </taglib>
    Any thoughts/help greatly appreciated...

    I encountered the same problem in our environment. I did the same thing as
              James. Simply re-initialize all variables in the do end tag.
              Also, with the nested tags you use you may also need to implement cloneable
              in the inner tag if the outer tag keeps references to all the inner tag
              instances.
              For instance if the outer tag kept a vector of references to the inner tag,
              then you would need to use clone() on the inner tag before adding it to the
              vector.
              "James Lynn" <[email protected]> wrote in message
              news:3af05d29$[email protected]..
              > > But
              > > with WL 6.0, the cell tag handler reuse the same instance each time the
              > cell tag
              > > is called and the member field is not reset
              >
              > I had the same problem. As a work around, I reinitialize everything in my
              > doEndTag() method and it works.
              >
              >
              > --
              > James Lynn - Lead Software Architect
              > Oakscape - Java Powered eBusiness Solutions <http://www.oakscape.com/>
              >
              >
              

  • Problems with custom tags (Tomcat 4.1)

    I have been trying to set up an existing web application to use a custom tag library. I have these tag-related files:
    /photodb/WEB-INF/photodb.tld
    /photodb/WEB-INF/classes/PhotoListTag.class
    /photodb/photolist.jsp
    This is how i have the photoList tag configured in photodb.tld
    <tag>
    <name>photoList</name>
    <tag-class>PhotoListTag</tag-class>
    <body-content>JSP</body-content>
    <attribute>
    <name>startIndex</name>
    </attribute>
    </tag>
    When i try to view photolist.jsp, i get this error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\photodb\photolist_jsp.java:73: cannot resolve symbol
    symbol : class PhotoListTag
    location: class org.apache.jsp.photolist_jsp
    PhotoListTag jspxth_photodb_photoList_0 = (PhotoListTag) jspxtagPool_photodb_photoList.get(PhotoListTag.class);
    ^
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\photodb\photolist_jsp.java:73: cannot resolve symbol
    symbol : class PhotoListTag
    location: class org.apache.jsp.photolist_jsp
    PhotoListTag jspxth_photodb_photoList_0 = (PhotoListTag) jspxtagPool_photodb_photoList.get(PhotoListTag.class);
    ^
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\photodb\photolist_jsp.java:73: cannot resolve symbol
    symbol : class PhotoListTag
    location: class org.apache.jsp.photolist_jsp
    PhotoListTag jspxth_photodb_photoList_0 = (PhotoListTag) jspxtagPool_photodb_photoList.get(PhotoListTag.class);
    ^
    3 errors
    I have tried many ideas, such as packaging the tag handler class, and putting the class file in other loctions, but nothing has helped.
    I know that Tomcat is recognizing PhotoListTag at some point (when it parses the TLD file, but not when compiling the JSP, I think), because if i change the <tag-class> to an invalid class, i get an "Unable to load class photoList" (which is a confusing error message btw, as photoList is not a class, but a tag name).
    Does anyone know how to fix this problem? I've been going in circles for hours, and i'm thinking this problem has a simple solution.

    Thank you for your quick replies. Unfortunately, they do not solve my problem. If I put PhotoListTag in the com.yourdomain package (and move it to classes/com/yourdomain), the error changes to reflect the different package (e.g. package com.yourdomain does not exist). Also, deleting the class files and restarting Tomcat did not cause any changes.
    Although my knowledge of how Tomcat works is limited, it seems to me that something like this is happening:
    When a request for /photodb/photolist.jsp is recieved, tomcat processes that file, processes the tld file, and checks for that any classes called using a tag--in this case <photodb:photoList>--exist. If the class is invalid, the error message "Unable to load class photoList" is given.
    Otherwise, it translates the jsp into java, and attempts to compile it. This is where the problem occurs. It seems that the jasper compiler does not know where to look for the PhotoListTag class. Is there a way that this can be changed, or is could the problem be caused by something else?

  • JSP include problem

    I am facing problems with the JSP include functionality in my project.
    What I want to do is to include jsp files on the fly i.e depending on the business need I should be able to swap in and out jsps from the main jsp.
    I plan to do this by feeding the file names in a request attribute and then including the files in the order given.
    But on using the jsp:include there is no output generated by the included jsp.
    There is no error either in the log or in the page directly.
    Please help me in finding out what exactly is the issue here.
    the files are index.jsp --> rightRailIncludeFiles.jsp --> dynamically loaded jsps (These may themselves contain other included files)
    index.jsp
    <div id="right" class="testRight">
        <%@ include file="rightRailIncludeFiles.jsp" %>
    </div>
    rightRailIncludeFiles.jsp
    <%
        out.println("<h1>Dyna Include</h1>");
        String fileNames = (String)request.getAttribute("jspFiles");
        String[] fileList = fileNames.split(",");
        out.println("<!-- Files : " + fileNames + " -->");
    %>
    <%
    for(int i=0;i<fileList.length;i++) {
        try {
             out.print("<!-- "+fileList[i]+" -->");
    %>
        <jsp:include page="<%=fileList%>" flush="true"/>
    <%
    } catch(javax.servlet.ServletException e) {
    out.println("<h3 style=\"color:red\"> Error :"+e.getMessage()+"</h3>");
    %>
    *inlude_1.jsp (This file includes another file which has some common code)*<jsp:include page="include/inlude_1.jsp" flush="true">
    <jsp:param name="magicNumberText" value="${request.adMagicNumberText}" />
    <jsp:param name="setType" value="${request.adSetType}" />
    <jsp:param name="width" value="${request.adWidth}" />
    <jsp:param name="height" value="${request.adHeight}" />
    <jsp:param name="adOuterDivClass" value="${request.adOuterDivClass}" />
    </jsp:include>
    Edited by: danbrown on Feb 9, 2009 2:49 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Good morning,
    I am not sure that could be the real problem , but I guess your app server does not like the fact that you broke the try catch in two parts. In any case, you should not do that :) Mixing code and display is very painful for maintenance :)
    Have you tried to remove the jsp:include and see if the output is correctly produced?
    Best Regards
    Edmondo

  • Sub components problem in custom tag

    Hi!
    Im writing custom tag that do nothing but can contains other components.
    So first I create custom tag with hendler that extends UIComponentTag and component class that extends UIComponentBase
    now tag work but i dont see sub components on the page
    Second i override encodeChildren and getFamily methods with:
    public String getFamily() {       
            return "MyCaller";
    public void encodeChildren(FacesContext context) throws IOException {
            Iterator ch=this.getChildren().iterator();
            while(ch.hasNext()){
                 UIComponent oKid = (UIComponent)ch.next();
                 if(oKid.isRendered()){
                    oKid.encodeBegin(context);
                    oKid.encodeChildren(context);
                    oKid.encodeEnd(context);
            super.encodeChildren(context);
        }But subcomponents not rendered on page.
    So are you know whats wrong

    the problem was in wrong getComponentType() that return wrong value

  • Problem creating custom tag

    I tried to create a simple custom tag using apache webserver. my jsp file is HelloWorld.jsp (for presentation, codes listed below), my HelloWorld.java class (listed below) ,a and my TLD file is called WoaTagLibDesc (also listed below). I ran this and I got this error message below:
    HTTP status 404
    type status report
    message:
    description The requested resource () is not available.
    Apache Tomcat/6.0.18
    Can anybody advise me on what to do please
    (1) HelloWorld.jsp
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@taglib uri="/WEB-INF/woatags/WoaTagLibDesc.tld" prefix="mt" %>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
            <mt:helloWorld/>
        </body>
    </html>
    (2) WoaTagLibDesc.tld<?xml version="1.0" encoding="UTF-8"?>
    <taglib version="2.0" 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">
    <tlib-version>1.0</tlib-version>
    <short-name>woataglibdesc</short-name>
    <uri>/WEB-INF/woatags/WoaTagLibDesc</uri>
    <tag>
    <name>helloWorld</name>
    <tag-class>woatag.HelloWorldTag</tag-class>
    <body-content>empty</body-content>
    </tag>
    </taglib>
    (3) HelloWorldTag.java
    import java.io.IOException;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class HelloWorldTag implements Tag {
        private PageContext pageContext;
        private Tag parent;
        public HelloWorldTag() {
            super();
        public void setPageContext(final PageContext pageContext) {
            this.pageContext = pageContext;
        public void setParent(final Tag parent) {
            this.parent = parent;
        public javax.servlet.jsp.tagext.Tag getParent() {
            return parent;
        public int doStartTag() throws JspException {
            return SKIP_BODY;
        public int doEndTag() throws JspException {
            try {
                pageContext.getOut().write("Hello World!");
            } catch (IOException e) {
                throw new JspTagException("IO Error: " + e.getMessage());
            return EVAL_PAGE;
        public void release() {
    }

    Your class (according to what is posted) is in the package mytag.
    So in your tld: <tagclass>tag.Hello</tagclass>should be<tagclass>mytag.Hello</tagclass>cheers,
    evnafets

  • How to do a jsp:include inside a noscript tag??

    I am new to JSP and I need help to do a <jsp:include page="pageName" /> inside a <noscript> tag. My goal is to include another jsp if the user has javascript disabled on its browser.
    I am using a JSP template that retrieves content from the Database, so I need to pass a parameter also, like:
    <noscript>
    <jsp:include page="/include/template.jsp" flush="true"/>
         <jsp:param name="pageName" value="holidays_onboard_html"/>
    </noscript>
    My code doesn't seem to work. I found an explanation that says that the noscript tag is interpreted after the servlet already tried to compose the original page, so I can't use a <jsp:include> tag inside the noscript tag. Is it true? Is there any other solution for what I am trying to accomplish?
    Thanks a lot!

    Java indeed runs at the server side, not at the client side. Java runs at the server side and produces a HTML page. HTML only runs at the client side.
    The <noscript> tag is not a Java/JSP tag, it is a HTML tag. What you want is only possible when you checked in Java if the client has JS enabled, e.g. using a request parameter, or by loading the page template using a HTML tag, e.g. <iframe>.

  • Problem with custom tags

    Hello..
    I have created custom tags and she gives an error me.
    The code is:
    <%@ taglib uri="mitaglib.tld" prefix="ejemplos" %>
    <HTML>
    <HEAD>
    <TITLE>Tag Hola Mundo</TITLE>
    </HEAD>
    <ejemplos:holamundo/><br>
    <ejemplos:SumaTag num1="2" num2="6" />
    </BODY>
    </HTML>
    The class:
    package helperClasses;
    import java.io.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class hm extends TagSupport{
    public int doStartTag() throws JspException
    try
    pageContext.getOut().print("Hola Mundo");
    catch (IOException e)
    throw new JspException("Error: IOException" + e.getMessage());
    return SKIP_BODY;
    public int doEndTag() throws JspException
    return EVAL_PAGE;
    package helperClasses;
    import java.io.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class SumaTag extends TagSupport{
    private int num1,num2;
    public void setNum1(int num1){
    this.num1 = num1;
    public void setNum2(int num2){
    this.num2 = num2;
    public int doStartTag() throws JspException {
    try{
    pageContext.getOut().print("Suma: " + (num1+num2));
    } catch (IOException e) {
    throw new JspException ("Error: IOException" +
    e.getMessage());
    return SKIP_BODY;
    public int doEndTag() throws JspException {
    return SKIP_PAGE;
    The file mitaglib.tld is:
    <?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>ejemplos</shortname>
    <uri></uri>
    <info>Etiquetas de ejemplo</info>
         <tag>
         <name>holamundo</name>
         <tagclass>helperClasses.hm</tagclass>
         <bodycontent>empty</bodycontent>
         <info>Saludo</info>
         </tag>
         <tag>
         <name>suma</name>
         <tagclass>helperClasses.SumaTag</tagclass>
         <bodycontent>empty</bodycontent>
         <info>Saludo</info>
         <attribute>
         <name>num1</name>
         <required>true</required>
         <rtexprvalue>false</rtexprvalue>
         </attribute>
         <attribute>
              <name>num2</name>
         <required>true</required>
         <rtexprvalue>false</rtexprvalue>
         </attribute>
         </tag>
    </taglib>

    [22/Dec/2003:09:43:47] failure (11848): Internal error: Unexpected error condition thrown (unknown exception,no description), stack: java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;Z)V
         at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:518)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:426)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:379)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:227)
         at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:701)
         at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:110)
         at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:218)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadJSP(JspServlet.java:193)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.access$4(JspServlet.java:167)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:477)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:589)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
         at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:897)
         at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1065)
         at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:959)

  • Problem creating custom tags for site that has no outside internet connecti

    I've created a set of custom tags that work fine until we install our app at the customer site. The customer site has no outside Internet access, and so the DOCTYPE is failing since it references the web-jsptaglibrary_1_1.dtd located on Sun's site.
    I tried copying the dtd locally and got it to work, but the solution sucks because this web-jsptaglibrary_1_1.dtd file is referenced in both my taglib.tld file AND the web-jsptaglibrary_1_1.dtd itself. Soooo....I can put in a URL that references it on the local machine, e.g.,
    In the taglib.tld file:
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.// DTD JSP Tag Library 1.1//EN"
    "http://ClientAAA/web-jsptaglibrary_1_1.dtd">
    In the web-jsptaglibrary_1_1.dtd file:
    <!ATTLIST taglib id ID #IMPLIED
    xmlns CDATA #FIXED
    "http://ClientAAA/AdProduction/web-jsptaglibrary_1_1.dtd"
    >
    but that means for every client that uses this app (and we have several) I have to change that URL inside both these files.
    I tried simply changing it to the relative "web-jsptaglibrary_1_1.dtd", e.g.,
    taglib.tld:
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.// DTD JSP Tag Library 1.1//EN"
    "web-jsptaglibrary_1_1.dtd">
    web-jsptaglibrary_1_1.dtd:
    <!ATTLIST taglib id ID #IMPLIED
    xmlns CDATA #FIXED
    "web-jsptaglibrary_1_1.dtd"
    >
    but then it is requiring me to put the dtd in both my web app root directory AND my jakarta/bin directory. I get the following error:
    XML parsing error on file ../vtaglib.tld: java.io.FileNotFoundException: D:\jakarta\jakarta-tomcat-4.1.29\bin\web-jsptaglibrary_1_1.dtd (The system cannot find the file specified)
    It seems like I must be missing something here. This shouldn't be this hard. And it seems funny that to use custom tags, you have to have Internet access in the first place.
    Help!!! :)
    Thanks.

    Yeah, I think it's a bit ridiculous that in order to make all the tag library examples and instructions work, you have to have access to the Internet. I haven't seen a single example on how to make it work if there is no Internet access. That's very limiting. And I've tried all sorts of other ways of doing it, such as
    <!DOCTYPE taglib SYSTEM "web-jsptaglibrary_1_1.dtd">
    but even then it won't work because I get an error message saying:
    XML parsing error on file /assets/../vtaglib.tld: java.io.FileNotFoundException: D:\jakarta\jakarta-tomcat-4.1.29\bin\web-jsptaglibrary_1_1.dtd (The system cannot find the file specified)
    I just don't think I should have to place this file in the bin directory. There has to be another way. Do I need to modify the dtd somehow? Cuz the dtd has the following line...is this messing it up??
    <!ATTLIST taglib id ID #IMPLIED xmlns CDATA #FIXED "web-jsptaglibrary_1_1.dtd">
    I sure could use some help.

  • Problem using custom tag library in portlet's jsp

    Hi,
    I created a custom portlet (a JSR 168 portlet) and I'm using a tag library that I previously developed. Normally it works fine, but sometimes I get a ClassCastException. Once I redeploy the portlet everything works again. This is Oracle Portal 10.1.4.
    Has anybody encountered similar problems?
    Here's the exception:
    taglib exception:
    java.lang.ClassCastException at timecardreminderportlet.html._view._jspService(_view.java:201) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at oracle.webdb.wsrp.server.RequestDispatcherImpl.include(Unknown Source) at org.mitre.isis.trs.reminder.portlet.TimecardReminderPortlet.doDispatch(TimecardReminderPortlet.java:108) at javax.portlet.GenericPortlet.render(Unknown Source) at oracle.webdb.wsrp.server.Server.getMarkup(Unknown Source) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.invoke_getMarkup(WSRP_v1_Markup_PortType_Tie.java:224) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.processingHook(WSRP_v1_Markup_PortType_Tie.java:499) at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:230) at com.sun.xml.rpc.server.http.ea.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:153) at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.webdb.wsrp.server.ContextFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

    Hi,
    I created a custom portlet (a JSR 168 portlet) and I'm using a tag library that I previously developed. Normally it works fine, but sometimes I get a ClassCastException. Once I redeploy the portlet everything works again. This is Oracle Portal 10.1.4.
    Has anybody encountered similar problems?
    Here's the exception:
    taglib exception:
    java.lang.ClassCastException at timecardreminderportlet.html._view._jspService(_view.java:201) at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824) at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121) at oracle.webdb.wsrp.server.RequestDispatcherImpl.include(Unknown Source) at org.mitre.isis.trs.reminder.portlet.TimecardReminderPortlet.doDispatch(TimecardReminderPortlet.java:108) at javax.portlet.GenericPortlet.render(Unknown Source) at oracle.webdb.wsrp.server.Server.getMarkup(Unknown Source) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.invoke_getMarkup(WSRP_v1_Markup_PortType_Tie.java:224) at oracle.webdb.wsrp.WSRP_v1_Markup_PortType_Tie.processingHook(WSRP_v1_Markup_PortType_Tie.java:499) at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:230) at com.sun.xml.rpc.server.http.ea.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:153) at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:69) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.webdb.wsrp.server.ContextFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224) at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)

  • 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)

Maybe you are looking for

  • Web Service Connection Timeout - Whats the default value?

    Does anyone know the default value of connection timeout property in Web Service activity? One of my web service takes longer time for processing. So just wanted to know this value for debugging. Thanks, Nith

  • Search list button active in Find Mode

    Hi all, On the item master in Find mode, the search list button on the preferred vendor field is not working. Is this correct? Thanks, jane

  • Integrating Portal and BI Systems

    Hi All, I am having an error on integrating Portal and BI systems. In Portal, when i navigate to the respective iview, i am being asked for my user name and password in a popup box (for the Web As server of the portal). After entering my password thr

  • Multiple "login" and "System" keychains

    My menu bar lock icon shows two entries for keychain "login". There are also 2 entries for "login" in Keychain access. This is also true for my "System" keychain. They can be both locked, both unlocked or one of each. If I delete the extra one, they

  • AE Error encountered during update (U44M1P7)

    Hi. Updating AE CC, on Mac OSX 10.9.5. "Errors encountered during installation (U44M1P7), What do I do next? Thanks, Joe Boulden