PageContext in Custom tag?

Hi,
How can a custom tag handler obtain instance of PageContext?

Hi
When you extend TagSupport or BodyTagSupport the "pageContext" object which is a protected member of the TagSupport class is automatically available to your TagHandler class.
Keep me posted.
Good Luck!
Eshwar Rao
Developer Technical Support
Sun microsystems
http://www.sun.com/developers/support

Similar Messages

  • Obj PageContext null in a Custom Tag

    Hi Every body
    I'm Mauricio and my problem is :
    I did a Custom tag and when I invoke it the PageContext object in the tag is null, I don't know why.
    Any suggestion about the reason of this problem, will be a great help.
    The source of Custom tag is :
    package expert.esecurity.tag;
    import java.io.IOException;
    import javax.servlet.ServletRequest;
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.JspWriter;
    import javax.servlet.jsp.PageContext;
    import javax.servlet.jsp.tagext.TagSupport;
    public class SE_TagDynamicAction extends TagSupport
    private PageContext objPageContext;
    private String sbClazz;
    private String sbMethod;
    public void setPageContext(PageContext objPageContext)
    this.objPageContext = objPageContext;
    public void setSbClazz(String sbClazz)
    this.sbClazz = sbClazz;
    public void setSbMethod(String sbMethod)
    this.sbMethod = sbMethod;
    public int doStartTag() throws JspException
    try
    if(objPageContext!=null){ //the obj objPageContext is null
    JspWriter out = pageContext.getOut();
    ServletRequest objServletRequest = pageContext.getRequest();
         //Do the functionality and print reult
         out.print( result );
    else{
    throw new JspException("Object pageContext of the SE_TagDynamicAction tag is null");
    catch (BA_UTException objBA_UTException)
    throw new JspException(objBA_UTException.getMessage());
    catch (IOException objIOException)
    throw new JspException(objIOException.getMessage());
    return SKIP_BODY;
    public int doEndTag()
    return EVAL_PAGE;
    }

    Your setPageContext didn't make the context null, the context was never null. YOUR objPageContext, however, was null.
    Did you notice that you were checking for the existing of YOUR objPageContext (i.e != null) yet you were pulling, however you were pulling the request and writers from the default pageContext:
    try
    if(objPageContext !=null){ //the obj objPageContext is null
    JspWriter out = pageContext.getOut(); // See, you didn't use objPageContext.getOut();
    ServletRequest objServletRequest = pageContext.getRequest();// or objPageContext.getRequest();
    //Do the functionality and print reult
    out.print( result );
    else{
    throw new JspException("Object pageContext of the SE_TagDynamicAction tag is null");
    }The point is, the setPageContext method is not guaranteed to be invoked by the system, this is there so YOU can assign a different pageContext if necessary. Therefore the setPageContext method was never called (as you never explicitly called it) and therefore your objPageContext was null. BUT, the default pageContext class variable was NOT null.
    HTH.

  • Help! pageContext is NULL in custom tag constructor!

    I'm having a problem with a custom tag class, and I'm not sure whether it's because I'm doing something wrong, or because I'm running into a bug with Tomcat, JDK1.4b2, or something else. Basically, I'm finding that the pageContext object is null in the constructor of a custom tag class... something that I'm pretty sure is NOT supposed to happen.
    I'm running JDK1.4b2 with Forte CE 3.1 (the bug predates the jumbo fix that brought it up to 3.0) and using Forte's embedded Tomcat.
    I'm not sure whether it matters, but here's the sequence of events:
    A servlet gets launched,
    instantiates an object of type Error_list,
    binds Error_list to the request object, and
    forwards to a JSP that uses the custom tag defined by ListErrorsTag.
    Unfortunately, pageContext is null in ErrorListTag's constructor, so the attempt to get the request object from the pageContext object generates a NullPointerException.
    The SERVLET: *****************************************
    // relevant lines from the servlet instantiating the object, binding it, and forwarding...
         Error_list errors = new Error_list("BAD_THINGS", "crash and burn");
         request.setAttribute("errors",errors);
         ServletContext sc = this.getServletContext();
         RequestDispatcher rd = sc.getRequestDispatcher("admin_category_create.jsp");
         rd.forward(request,response);
    The JSP: ************************************************
    In the JSP "admin_category_create.jsp" itself, I specify the taglib:
         <%@ taglib uri='/WEB-INF/AdminTags.tld' prefix = 'admin' %>
    and reference it:
         <admin:listErrors>The errors will be listed here</admin:listErrors>
    The Explosion of the Taglib: ************************
    // beginning of Taglib class:
    public class ListErrorsTag extends BodyTagSupport {
        private Error_list errors;
        public ListErrorsTag() {
        super()
        try {
             if (pageContext == null)
                 System.out.println("uh oh! pageContext is null");
             ServletRequest request = pageContext.getRequest();
             errors = (Error_list)request.getAttribute("errors");
        catch (NullPointerException e) {
             System.out.println("boom!");
    The Result: **************************************
    Tomcat's error log:
    uh oh! pageContext is null
    boom!
    if I eliminate the try/catch and allow the NullPointerException to take place, I get:
    Error: 500
    Location: /admin_category_create.jsp
    Internal Servlet Error:
    javax.servlet.ServletException
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
         at _0002fadmin_0005fcategory_0005fcreate_0002ejspadmin_0005fcategory_0005fcreate_jsp_0._jspService(_0002fadmin_0005fcategory_0005fcreate_0002ejspadmin_0005fcategory_0005fcreate_jsp_0.java:338)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
         at org.netbeans.modules.web.tomcat.JspServlet.service(JspServlet.java:91)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
         at org.apache.tomcat.core.Handler.service(Handler.java:286)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:194)
         at admin.processRequest(admin.java:126)
         at admin.doPost(admin.java:144)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
         at org.apache.tomcat.core.Handler.service(Handler.java:286)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
         at java.lang.Thread.run(Thread.java:539)
    Root cause:
    java.lang.NullPointerException
         at AdminTags.ListErrorsTag.(ListErrorsTag.java:32)
         at _0002fadmin_0005fcategory_0005fcreate_0002ejspadmin_0005fcategory_0005fcreate_jsp_0._jspService(_0002fadmin_0005fcategory_0005fcreate_0002ejspadmin_0005fcategory_0005fcreate_jsp_0.java:272)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
         at org.netbeans.modules.web.tomcat.JspServlet.service(JspServlet.java:91)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
         at org.apache.tomcat.core.Handler.service(Handler.java:286)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:194)
         at admin.processRequest(admin.java:126)
         at admin.doPost(admin.java:144)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
         at org.apache.tomcat.core.Handler.service(Handler.java:286)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
         at java.lang.Thread.run(Thread.java:539)

    Doing a little more experimentation, I discovered that pageContext is null in the constructor, but not null in the otherDoStartTagOperations() method (called by the doStartTag() method of the tag's class... it's something Forte forces you to do).
    Is this normal? I was under the impression that pageContext is supposed to be defined EVERYWHERE in any class that extends BodyTagSupport... including the class' own constructor.
    On a related topic, is there documentation somewhere as to what, exactly, Forte is doing behind the scenes when it's managing a taglib (how it keeps track of them, where it puts config files, how the entries it makes in them are different or extended from the normal layout, etc.)? At the moment, I suspect that half of the grief I'm having with writing taglibs is caused by Forte itself forcing me to do things in a roundabout way that bears little resemblance to the ways shown in different books on the topic (and in fact all but ensures that nearly every published example will fail and require major rewriting because of the way it forces tag classes to be structured), but I don't see any easy way to let Forte handle compiling the classes and testing them with its embedded Tomcat, but do the config file housekeeping myself I can be in control of it.

  • Why doesn't my custom tag work?

    First, my backend database is MS Access. Nothing I can do about that, unfortunately.
    I have defined three custom tags (no body, no attributes) to display report information from my project tracking/metrics Access database:
    <prefix:showProjectInfo />
    <prefix:showProjectTeam />
    <prefix:showProjectHistory />
    In my JSP, the first tag I use, <prefix:showProjectInfo />, works perfectly. However, <prefix:showProjectTeam /> gives no output.
    First, here is the tld file that defines the tags (report.tld):
    <?xml version="1.0" encoding="UTF-8" ?>
    <!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.0</tlib-version>
        <jsp-version>1.2</jsp-version>
        <short-name>report</short-name>
        <uri>/report</uri>   
        <!-- Forte4J_TLDX:  This comment contains code generation information. Do not delete.
        <tldx>
            <tagHandlerGenerationRoot>classes</tagHandlerGenerationRoot>
        </tldx>
        -->
        <!-- A validator verifies that the tags are used correctly at JSP
             translation time. Validator entries look like this:
          <validator>
              <validator-class>com.mycompany.TagLibValidator</validator-class>
              <init-param>
                 <param-name>parameter</param-name>
                 <param-value>value</param-value>
           </init-param>
          </validator>
       -->
       <!-- A tag library can register Servlet Context event listeners in
            case it needs to react to such events. Listener entries look
            like this:
         <listener>
             <listener-class>com.mycompany.TagLibListener</listener-class>
         </listener>
       -->
       <tag>
            <name>showProjectInfo</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectInfoTag</tag-class>
            <body-content>empty</body-content>
            <description>Shows the basic project information</description>       
       </tag>
       <tag>
            <name>showProjectTeam</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectTeamTag</tag-class>
            <body-content>empty</body-content>
       </tag>
       <tag>
            <name>showProjectHistory</name>
            <tag-class>mil.usaf.rad.metrics.report.showProjectHistoryTag</tag-class>
            <body-content>empty</body-content>
       </tag>
    </taglib>Next, here is the relevant section of web.xml that defines this taglib:
      <taglib>
            <taglib-uri>/WEB-INF/report.tld</taglib-uri>
            <taglib-location>/WEB-INF/report.tld</taglib-location>
      </taglib>Next, the code for showProjectTeamTag.java:
    * showProjectTeam.java
    * Created on March 9, 2005, 10:46 AM
    package mil.usaf.rad.metrics.report;
    import java.io.*;
    import java.sql.*;
    import java.lang.Integer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * @author  jason.ferguson
    public class showProjectTeamTag extends TagSupport
        public showProjectTeamTag()
            super();
        public int doAfterBody() throws JspException
            HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
            int pr_id = Integer.parseInt(req.getParameter("pr_id"));
            JspWriter out = pageContext.getOut();
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            try
               out.print("test");
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               conn = DriverManager.getConnection("jdbc:odbc:Metrics");
            catch (Exception e)
                throw new JspException(e.getMessage());
            String queryGetTeam = "SELECT Projects.pr_id, Accounts.name AS Name, Sum(Schedule.hours) AS SumOfhours FROM tblTAAccounts AS Accounts INNER JOIN ((tblTAScheduleEntries AS Schedule INNER JOIN tblProjectRelease AS ProjectRelease ON Schedule.projectID = ProjectRelease.tblFKTimeAccntProject) INNER JOIN tblPMProjects AS Projects ON ProjectRelease.Release_ID = Projects.pr_id) ON Accounts.accountID = Schedule.accountID WHERE Projects.pr_id=" + pr_id + " GROUP BY Projects.pr_id, Accounts.name, ProjectRelease.Release_number, Projects.Project_name";
            try
                out.print(queryGetTeam);
                stmt = conn.createStatement();
                rs = stmt.executeQuery(queryGetTeam);
                if (rs == null)
                    out.print("No Results!");
                out.print("<table>\n");
                out.print("<tr>\n");
                out.print("<th>Name</th>\n");
                out.print("<th>Total Hours</th>\n");
                out.print("</tr>\n");
                while(rs.next())
                    out.print("<tr>\n");
                    out.print("<td>" + rs.getString("Name") + "</td>\n");
                    out.print("<td>" + rs.getInt("SumOfhours") + "</td>\n");
                    out.print("</tr>\n");
                out.print("</table>\n");
                rs.close();
                stmt.close();
                conn.close();
            catch (Exception e)
                throw new JspException(e.getMessage());
            return SKIP_BODY;
    }Finally, projectdetail.jsp, where the tag is called:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@page import="java.sql.*" %>
    <%@page import="java.lang.Integer" %>
    <%@taglib uri="/WEB-INF/report.tld" prefix="report" %>
    <html>
    <head><title>Project Detail</title></head>
    <body>
    <h1 align="center">Project Status</h1>
    <h3>Project Description</h3>
    <report:showProjectInfo />
    <h3>Team Members</h3>
    <report:showProjectTeam />
    </body>
    </html>The first tag, <report:showProjectInfo />, works fine. However, I get no output whatsoever when the system encounters <report:showProjectTeam />. I am a relative newbie at this, so any help is appreciated.
    Jason

    It doesnt seem to matter if the code is in doStartTag(), doEndTag(), orr any of the other functions.
    I also put, as the first item in the function:
    System.out.println("TEST");Nothing.
    Just as an aside, here is the code for the <prefix:showProjectInfo />. Maybe I made a mistake in it? I closed the resultset and connection...
    import java.io.*;
    import java.sql.*;
    import java.lang.Integer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    * @author  jason.ferguson
    public class showProjectInfoTag extends BodyTagSupport
        public int doEndTag() throws JspException
            HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
            int pr_id = Integer.parseInt(req.getParameter("pr_id"));
            JspWriter out = pageContext.getOut();
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            try
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                conn = DriverManager.getConnection("jdbc:odbc:Metrics");
            catch (Exception e)
                throw new JspException(e.getMessage());
            String queryProjectInfo = "SELECT * FROM tblPMProjects WHERE pr_id=" + pr_id;
            try
                stmt = conn.createStatement();
                rs = stmt.executeQuery(queryProjectInfo);
                while (rs.next())
                    out.print("<table border=\"1\" style=\"border-collapse:collapse\">\n");
                    out.print("<tr>\n");
                    out.print("<td><b>Project Name:</b>" + rs.getString("Project_name") + "</td>\n");
                    out.print("<td align=\"right\"><b>RAD Number:</b>" + rs.getString("tblProjectNumber") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Project description: " + rs.getString("Project_description") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer: " + rs.getString("Customer_POC") + "</td>");
                    out.print("<tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer Unit: " + rs.getString("Customer_OFC") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("<tr>\n");
                    out.print("<td>Customer Phone: " + rs.getString("Customer_phone") + "</td>\n");
                    out.print("</tr>\n");
                    out.print("</table>\n");
                    rs.close();
                    stmt.close();
                    conn.close();
            catch (Exception e)
                throw new JspException(e.getMessage());
            finally
                //conn.close();
            return SKIP_BODY;

  • Connection Pooling and JSP Custom Tag Library - is code (inside) the best way/correc?

    Hi, can anyone advise as to whether my tag library code (based
    on Apache Jakarta Project) will actually achieve connection
    pooling functionality across my entire JSP based application? I
    am slightly concerned that my OracleConnectionCacheImpl object
    may exist multiple times, hence rendering my conection pooling
    attempt useless.
    package com.solved.tag.dbtags.connection;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    import javax.servlet.jsp.JspTagException;
    import javax.sql.DataSource;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import oracle.jdbc.pool.OracleConnectionCacheImpl;
    * <p>JSP tag connection, used to get a
    * java.sql.Connection object.</p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>connection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.ConnectionTag&lt;/t
    agclass>
    * &lt;bodycontent>JSP&lt;/bodycontent>
    &lt;teiclass>com.solved.tag.dbtags.connection.ConnectionTEI&lt;/t
    eiclass>
    * &lt;info>Opens a connection based on a jndiName.&lt;/info>
    * &lt;attribute>
    * &lt;name>id&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    public class ConnectionTag extends TagSupport {
    static private OracleConnectionCacheImpl cache = null;
    public int doStartTag() throws JspTagException {
    try {
    Connection conn = null;
    if (cache == null) {
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup
    ("jdbc/pool/OracleCache");
    cache = (OracleConnectionCacheImpl)ds;
    catch (NamingException ne) {
    throw new JspTagException(ne.toString());
    conn = cache.getConnection();
    pageContext.setAttribute(getId(),conn);
    catch (SQLException e) {
    throw new JspTagException(e.toString());
    return EVAL_BODY_INCLUDE;
    package com.solved.tag.dbtags.connection;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.jsp.tagext.TagSupport;
    * <p>JSP tag closeconnection, used to close the
    * specified java.sql.Connection.<p>
    * <p>JSP Tag Lib Descriptor
    * <pre>
    * &lt;name>closeConnection&lt;/name>
    &lt;tagclass>com.solved.tag.dbtags.connection.CloseConnectionTag&
    lt;/tagclass>
    * &lt;bodycontent>empty&lt;/bodycontent>
    * &lt;info>Close the specified connection. The "conn"
    attribute is the name of a
    * connection object in the page context.&lt;/info>
    * &lt;attribute>
    * &lt;name>conn&lt;/name>
    * &lt;required>true&lt;/required>
    * &lt;rtexprvalue>false&lt;/rtexprvalue>
    * &lt;/attribute>
    * </pre>
    * @author Matt Shannon
    * @see ConnectionTag
    public class CloseConnectionTag extends TagSupport {
    private String _connId = null;
    * The "conn" attribute is the name of a
    * page context object containing a
    * java.sql.Connection.
    * @param connectionId
    * attribute name of the java.sql.Connection to
    close.
    * @see ConnectionTag
    public void setConn(String connectionId) {
    _connId = connectionId;
    public int doStartTag() {
    try {
    Connection conn = (Connection)pageContext.getAttribute
    (_connId);
    conn.close();
    } catch (SQLException e) {
    // failing to close a connection is not fatal
    e.printStackTrace();
    return EVAL_BODY_INCLUDE;
    public void release() {
    _connId = null;
    package com.solved.tag.dbtags.connection;
    import javax.servlet.jsp.tagext.TagData;
    import javax.servlet.jsp.tagext.TagExtraInfo;
    import javax.servlet.jsp.tagext.VariableInfo;
    * TagExtraInfo for the connection tag. This
    * TagExtraInfo specifies that the ConnectionTag
    * assigns a java.sql.Connection object to the
    * "id" attribute at the end tag.
    * @author Matt Shannon
    * @see ConnectionTag
    public class ConnectionTEI extends TagExtraInfo {
    public final VariableInfo[] getVariableInfo(TagData data)
    return new VariableInfo[]
    new VariableInfo(
    data.getAttributeString("id"),
    "java.sql.Connection",
    true,
    VariableInfo.AT_END
    data-sources.xml:
    <?xml version="1.0"?>
    <!DOCTYPE data-sources PUBLIC "Orion data-
    sources" "http://xmlns.oracle.com/ias/dtds/data-sources.dtd">
    <data-sources>
    <data-source
    class="oracle.jdbc.pool.OracleConnectionCacheImpl"
    name="jdbc/pool/OracleCache"
    location="jdbc/pool/OracleCache"
    url="jdbc:oracle:thin:@oracle1:1521:pdev"
    >
    <property name="maxLimit" value="15" />
    <property name="cacheScheme" value="2" />
    <property name="user" value="console" />
    <property name="password" value="console" />
    <description>
    This DataSource is using an Oracle-native DataSource Class so as
    to allow Oracle Specific extensions.
    A getConnection() call on this DataSource will return
    oracle.jdbc.driver.OracleConnection.
    The connection returned is a logical connection.
    The caching scheme in place is Fixed Wait. Refer below to
    possible values.
    Dynamic 1
    Fixed Wait 2
    Fixed Return Null 3
    </description>
    </data-source>
    </data-sources>
    many thanks,
    Matt.

    Hi. Show me your pool definition.
    Joe
    Ramamurthy wrote:
    I am using the jsp custom tag library from BEA called sqltags.tld which came with Weblogic 5.1. Currently I am using Weblogic6.1 sp2 on Solaris.
    I have created a Connection Pool for Sybase database using the driver com.sybase.jdbc.SybDriver.
    When I created jsp page to connect to the connection pool using sqltags custom tag library, I am getting the error
    "javax.servlet.jsp.JspException: Failed to write body content
    at weblogic.taglib.sql.ConnectionTag.doAfterBody(ConnectionTag.java:43)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:1014)"
    After this message, whenever I try to access the same jsp page I am getting the message
    "javax.servlet.jsp.JspException: Failed to load JDBC driver: weblogic.jdbc.pool.D
    river
    at weblogic.taglib.sql.ConnectionTag.doStartTag(ConnectionTag.java:34)
    at jsp_servlet.__hubwcdata._jspService(__sampletest.java:205)".
    Can you please help me the reason why this problem is happening and how to fix this ?
    This problem doexn't happen consistently. This occurs once in a while.
    I tried to increase Login delay Seconds parameter in the Connection Pool to 15 sec. It didn't help me much.
    Thanks for your help !!!
    Ram

  • Is possible to write a custom tag inside another custom tag ??

    Hi
    I�m trying to reduce the time needed to code mi app presentation layer, it uses some custom tags with certain configuration, i would like to know if its possible to do something like this inside my custom tag doAfterBody().
    public int doAfterBody() throws JspException {
              JspWriter writer=bodyContent.getEnclosingWriter();
              try {
                   writer.print("<customTag:myAnotherTag someEspecificConfigurationParams="someEspecificValues"/>");
              } catch (IOException e) {
                   pageContext.getServletContext().log("Error: "+e.getMessage());
              }return SKIP_BODY;
         }The goal is to simplify the jsp code because the configuration params for the custom tags (css styles and similar) are allways the same.
    That don�t work, it simply prints <customTag:myAnotherTag/> in screen but the tag is not evaluated, i�ve tried too something like
    public int doAfterBody() throws JspException {
              if (repeat) {
                   JspWriter writer = bodyContent.getEnclosingWriter();
                   try {
                        writer.print("<customTag:myAnotherTag/>");
                   } catch (IOException e) {
                        pageContext.getServletContext().log("Error: " + e.getMessage());
                   repeat = false;
                   return EVAL_BODY_AGAIN;
              return SKIP_BODY;
         }And it doesn�t worked worked. Maybe using the taghandler classes and calls to the doAfterBody could make it work, but when you need to nest tags it could be a little hell of coupling calls, so before doing it i would like to know if what i want is possible. After reading some books i tought it could work because the stack of out objects, but i can�t make it work.
    Another idea is to inherit from tagHandler and override some properties in the tags, but i don�t like the idea to much.
    So, can anyone help me??
    Thanks.

    You cannot do that and I have listed out the reason and a possible solution in this post http://forum.java.sun.com/thread.jspa?threadID=697243 from yesterday.
    cheers,
    ram.

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

  • Runtime failure in custom tag

              I was curious if you knew what specifically you did to remove the runtime error.
              I am also getting the runtime failure. The try/catch that another discussion thread
              suggested does not catch the error since the exception is thrown prior to the
              doStart and doEnd Tag methods. I know that the exception is thrown immediately
              after the constructor is called for the tag and before the setParent method is
              called.
              Anyway, thank you in advance for any suggestions you might have.
              try { // begin instantiate/release try/catch/finally block... //[ /wattage/wtgMainMenu.jsp;
              Line: 36]
                   westerncommon_jsptag_HeaderTag_0 = (western.common.jsptag.HeaderTag)java.beans.Beans.instantiate(getClass().getClassLoader(),
              "western.common.jsptag.HeaderTag"); //[ /wattage/wtgMainMenu.jsp; Line: 36]
              westerncommon_jsptag_HeaderTag_0.setPageContext(pageContext); //[ /wattage/wtgMainMenu.jsp;
              Line: 36]
              westerncommon_jsptag_HeaderTag_0.setParent(null); //[ /wattage/wtgMainMenu.jsp;
              Line: 36]
                   westerncommon_jsptag_HeaderTag_0.setNavMenuHREF(weblogic.utils.StringUtils.valueOf("wtgLogout.jsp"));
              //[ /wattage/wtgMainMenu.jsp; Line: 36]
              westerncommon_jsptag_HeaderTag_0.setNavMenu(weblogic.utils.StringUtils.valueOf("Logout"));
              //[ /wattage/wtgMainMenu.jsp; Line: 36]
              westerncommon_jsptag_HeaderTag_0.setTitle(weblogic.utils.StringUtils.valueOf("Main
              Menu")); //[ /wattage/wtgMainMenu.jsp; Line: 36]
              int int0 = westerncommon_jsptag_HeaderTag_0.doStartTag(); //[ /wattage/wtgMainMenu.jsp;
              Line: 36]
                   if (_int_0 == BodyTag.EVAL_BODY_TAG) { //[ /wattage/wtgMainMenu.jsp; Line: 36]
                        throw new JspTagException("Since tag class western.common.jsptag.HeaderTag does
              not implements BodyTag, it cannot return BodyTag.EVAL_BODY_TAG"); //[ /wattage/wtgMainMenu.jsp;
              Line: 36]
              } //[ /wattage/wtgMainMenu.jsp; Line: 36]
              /*** sync AT_BEGIN TagExtra Vars here ***/ //[ /wattage/wtgMainMenu.jsp;
              Line: 36]
              if (_int_0 != Tag.SKIP_BODY) { // begin !SKIP_BODY... //[ /wattage/wtgMainMenu.jsp;
              Line: 36]
                        //[ /wattage/wtgMainMenu.jsp; Line: 36]
                        out.print("\r\n");
                             //[ /wattage/wtgMainMenu.jsp; Line: 37]
                   } // end !SKIP_BODY //[ /wattage/wtgMainMenu.jsp; Line: 37]
              if (_western_common_jsptag_HeaderTag_0.doEndTag() == Tag.SKIP_PAGE) return;
              //[ /wattage/wtgMainMenu.jsp; Line: 37]
              } catch (java.lang.Exception javalang_Exception_0) { // instantiate/release
              try/catch/finally //[ /wattage/wtgMainMenu.jsp; Line: 37]
                   throw new ServletException("runtime failure in custom tag 'HeaderTag'", javalang_Exception_0);
              //[ /wattage/wtgMainMenu.jsp; Line: 37]
              } finally { // instantiate/release try/catch/finally block... //[ /wattage/wtgMainMenu.jsp;
              Line: 37]
                   if (_western_common_jsptag_HeaderTag_0 != null) westerncommon_jsptag_HeaderTag_0.release();
              //[ /wattage/wtgMainMenu.jsp; Line: 37]
              } //[ /wattage/wtgMainMenu.jsp; Line: 37]
              ----------CONSOLE OUTPUT-------------
              Getting Page permissions for page: wtgMainMenu.jsp user: 0
              Page Permissions: Insert-1 View-1 Update-1 Delete-1
              HeaderTag -- Constructing
              Thu Apr 05 11:19:00 CDT 2001:<E> <ServletContext-General> exception raised on
              wattage/wtgMainMenu.jsp'
              javax.servlet.ServletException: runtime failure in custom tag 'HeaderTag'
              at jsp_servlet.wattage.wtgmainmenu._jspService(wtgmainmenu.java:398)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:124)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:744)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:692)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              ContextManager.java:251)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              a:363)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              

    I just started getting this error after a year in production environment without any problems. Did you every find out what caused this or better yet how to prevent this?
              Dan.
              

  • Questions in Custom Tag

    Hi,
    I have couple of questions in Custom Libraray Tags:
    1) How I can from Tag Java file to open a new JSP window without the toolbars and determine the window size.
    2) How I can read a JSP parameter from Tag Java file. For example I have a field called "x" in JSP is not connected to the TAG by setAttribute.
    3) How I can pass a dynamic value to custom tag. <route:routeList agentID = "1" >
    how I can change the "1" to a field. When I change it to: <route:routeList agentID = "<%=request.getParameter("agentID")%>" > or to <route:routeList agentID = <%=request.getParameter("agentID")%> > I get empty value, even though the field has a value.
    Thank you ...

    [email protected] ... Well, if you put something as an attribute in the pageContext object, you can get it... same as request or session scope attributes, but I thought the OP meant to do this (I guess not, though.. see below):
    <%
    String str = "...";
    %>
    <mytag:stuff .... />
    And within the stuff tag, use str as a variable. I don't believe that's possible, because the compiled page in effect becomes like this:
    String str = "...";
    doStuffTag(whatever the parameters are);
    Obviously that's not the right naming for the tag, but you get the idea...
    JavaUserProg....
    2) First, it's best to put quotes around the tag attributes...
    <INPUT readOnly style="WIDTH: 84px; HEIGHT: 22px" name="operation[<%= lineNum%>"] value="<%=operation%>">
    Second, do you mean you want to read from the tag what the HTML input field has in it? First, you have to submit the form, then the call request.getParameter("fieldname") to get the value. Otherwise, I'm not clear on what you are really trying to do.
    3) If the field in the tag is an int field: setAgentID(int)
    Then you can define the tag value as:
    <mytag:stuff agentID="1" />
    or
    <% int aid = 1; %>
    <mytag:stuff agentID="<%= aid %>" />
    If you just put a static string value like the first way, it converts it. If you put an expression, the expression has to match the type of value it really is. So int for int, String for String, Collection for Collection.

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

  • Custom Tag: pass my own type in as attribute

    I thought I can pass any type as attribute into my custom tag. I tried, but failed. The exception is:
    org.apache.jasper.JasperException: Unable to convert '${myType}' to class MyTpye for attribute myAttribute: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager.
    I know I can pass the value in using PageContext attribute. However, still want to figure out how to do it through custom tag attribute.
    Here's my taglig file:
    <tag>
    <name>myTag</name>
    <tag-class>MyTagClass</tag-class>
    <body-content>empty</body-content>
    <attribute>
    <name>myAttribute</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <type>MyType</type>
    </attribute>
    </tag>
    What am I missing here? Thanks.

    Hi
    Pls tell me how did you resolve this issue. I am also facing the same problem.
    Thanks
    Prakash

  • Custom Tag using object as an attribute.

    I have read up on trying to pass an object as an attribute to a custom tag.
    Is it true that the only way to do this is to put the object, using a "key name" in the pageContext
    Then in the custom tag, set an attribute equal to the "Key Name"
    Then in the TagHandler, to do a lookup using the "Key Name"
    We can not just past objects into the attribute?
    And what is this about using EL or JSP2.0
    sorry sort of new to the whole game.

    Certainly you can pass objects to tags.
    However you need to use a runtime expression to do that.
    such as <%= expr %> or (with JSP2.0) ${expr}
    If you look at the JSTL library, it uses the EL and passes in objects all the time. However the EL actually accesses the page/request etc attributes as its variable space, so you are still technically using attributes.
    Is it true that the only way to do this is to put the object, using a "key name" in the pageContext
    then in the custom tag, set an attribute equal to the "Key Name"
    then in the TagHandler, to do a lookup using the "Key Name"That is one way of doing it. The struts libraries use this method extensively. It is more suited to JSP1.2.
    Sometimes it is easier/neater just to put the value into a scoped attribute, and pass in the name of that attribute. That way you don't need to worrry about the type of the attribute at all in your JSP.
    Hope this helps some,
    evnafets

  • Custom Tag in race condition with OC4J v9.0.2.0.0...

    Hello all,
    (I tried deploying my application with OC4J 9.0.3 but none of my existing
    tags worked)
    I developed a OC4J web application implementing my own tag library extension
    and found out that there was occurring a race condition to the fact that two
    users (different sessions) where accessing the same
    tag at the same time. In the offending tag implementation I only have
    instance members and not static which could also cause a
    concurrent access problem.
    I found that OC4J was reusing concurrently the same
    Tag instance when it should not do that!!!
    public class pagesIteratorTag extends BodyTagSupport {
    // only instance class members...
    public void doInitBody() throws JspException {
    System.out.println("pageSetIteratorTag::doInitBody - Tag instance value: " + this.toString() + " for user: " + this.pageContext.getSession().getAttribute("j_username"));
    public int doAfterBody() throws JspException {           
    System.out.println("pageSetIteratorTag::doAfterBody - Tag instance value: " + this.toString() + " for user: " + this.pageContext.getSession().getAttribute("j_username"));
    Note the pagesIteratorTag@2e same instance is used when it should not
    1 because the tag instance should be protected from multiple concurrent
    access even though it can be pooled and reused if it is free.
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Frank
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Frank
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    Session for user Frank throws a null pointer exception because Giovanni's session
    started accessing the variable.
    Can anyone advise please?
    Best Regards,
    Giovanni

    First of all, you said none of your tags worked in 9.0.3. What happened? Did you do any debugging of the problem?
    Comparing the "toString()" output of your tag does not guarantee they are the same instance. That is just the output of "hashcode()", not the "pointer" to the object. The hashcode is generated from the contents of the object, not its "identity".
    I suggest you track the NPE in the debugger and get more information before you assume the container is at fault (which is still an outside possibility). SDK API Javadoc
    Object class:
    The general contract of hashCode is:
    1-. Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
    So, the toString() is properly returning the suffix of the object instance
    number unique for that instance and is then being reused by OC4J even though
    it is being accessed from another session thread, that must not happen and it
    is not compliant with the JSP spec.
    The other history is that when I implemented my custom tags OC4J was JSP 1.1 compliant
    and not 1.2, so after moving to 1.2 the scripting variables can be defined in XML and
    by subclassing TagInfo class, the last option doesn't work with OC4J 9.0.3, not good...
    Thanks for your help,
    I will keep trying to figure out what the problem migth be,
    Best Regards,
    Giovanni

  • Custom Tag attribute

    Hi folks,
    I am trying to create a custom tag that accepts a java.util.Locale as a parameter, and for some reason the container is giving me all kinds of attitude. Here's the detail:
    ----from the .tld---
    <tag>
           <name>loadMasthead</name>
           <tag-class>uiTagHandlers.LoadMasthead</tag-class>
           <body-content>empty</body-content>
           <description>Paints the masthead for a given page</description>      
           <attribute>
                <name>locale</name>
                <required>false</required>
                <rtexprvalue>true</rtexprvalue>
             <type>java.util.Locale</type>
           </attribute>
      </tag> ---end tld--
    from the jsp-
    <%@ taglib uri="/WEB-INF/simpleUITags.tld" prefix="helper" %>
    <%@ page import="java.util.Locale" %>
    <helper:loadMasthead locale="<%= Locale.US %>" />---end jsp----
    ---from the handler-----
         public int doTagStart() throws JspTagException{
              JspWriter out = pageContext.getOut();
              try{
                   if( locale != null)          
                        out.print( UIHelper.loadMasthead(locale) );
                   else
                        out.print( UIHelper.loadMasthead() );
              }catch( Exception ex ){
                   throw new JspTagException( ex.getMessage() );
         return SKIP_BODY;
         public int doTagEnd() throws JspTagException{
         return SKIP_PAGE;
          * Sets the locale.
          * @param locale The locale to set
         public void setLocale(java.util.Locale locale) {
              this.locale = locale;
    end handler---
    Here's the error I'm getting from the container:
    [8/5/04 12:14:34:704 EDT] 7abbd628 WebGroup E SRVE0026E: [Servlet Error]-[Unable to convert string '<%= Locale.US %>' to class java.util.Locale for attribute locale: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager]: org.apache.jasper.JasperException: Unable to convert string '<%= Locale.US %>' to class java.util.Locale for attribute locale: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager
         at org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:920)
         at org.apache.jsp._index._jspService(_index.java:84)
         at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
    Any ideas what is going on here?
    Thanks in advance,
    Matt

    The taglib always passes a string. The container is supposed to change it to the proper object, but some do not, as it wasn't clear in the original specs (I found various bug reports). My container does not do this properly for taglibs, so I ended up using a bean, which it processed correctly.
    Your container can't figure out how to change the String it receives to the Locale object it's supposed to set the property to.
    I found a similar problem displayed here:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4727371
    You'd need to check with your container docs to see if yours is supposed to be able to do the conversion. If not, you'll either need to write it yourself or do what I did and use a bean so it never passes a string to begin with.

Maybe you are looking for

  • Itunes é legal, mas quando está sincronizando é um lixo, nem isso pq minha lixeira levanta a tampa mais rápido que o itunes!

    itunes é legal, mas quando está sincronizando é um lixo, nem isso porque minha lixeira levanta a tampa mais rápido que o itunes... ¬¬ Quando você coloca ele pra sincronizar por exempolo com o iphone (qualquer versão), o itunes deixa de ser um player

  • Use phone in Europe

    I want to use my iPhone 3 in Europe.  I went thru the process of unlocking it with AT&T in the US.  But I put in a European SIM card and it says "no service."  What else do I need to do? It is model#MB715LL/A I do not know if it is 3G or 3GS but AT&T

  • Hierarchy leaf not shown while data exists

    Hi experts, We have the following issue regarding the (in)visibility of hierarchy leafs: We know that transactional data exists for a particular item in the hierarchy (total value is zero). This item is not shown by default in the report output (whil

  • Unable to resolve component to compilation

    I am using the FB4 beta 2 with the latest stable build (4.0.0.13875) and am unable to use components within the same library project.  I have created a simple project as an example with two components, Simple and Composed.  They both extend s:Group.

  • Who changed Address Book SMS and Dial configuration settings ??

    Address Book suddenly stopped allowing me to SMS from my K610i mobile phone... Furtunately someone posted a fix where you can add the phone id string to the AddressBook application settings. Anyone know if there was there a recent update from Apple t