Custom tag fails to under Tomcat 5.0.16

I have just upgraded to Tomcat 5.0.16 from 4.1.x.
Any JSP page that contains a custom tag fails to build; error message:
org.apache.jasper.JasperException: /jsp/CustomReport.jsp(62,20) Unknown attribute type (String) for attribute name.
The tags work under �Tomcat 4.x�. All other pages build and function correctly.
Specs:
Java 2 version: 1.4.2_03
Tomcat 5.0.16 or Tomcat 4.1.x

Try updating your web.xml to use the Servlet 2.4 schema. You will have to change your tld declarations to sit inside the new <jsp-config> tags but see if it works for Servlet 2.4. Could be a backwards compatible bug?
Anthony

Similar Messages

  • All custom tags fail in JBoss3.2.3/Tomcat 5.0.16 (works in Tomcat 4.x)

    All pages that contain a custom tag fail with the following exception: HTTP Status 500 -
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
         org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:153)
         uploadQS1_jsp._jspx_meth_strutshtml_hidden_0(uploadQS1_jsp.java:225)
         uploadQS1_jsp._jspService(uploadQS1_jsp.java:100)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    note The full stack trace of the root cause is available in the Tomcat logs.Even a simple <struts-html: hidden ... /> tag causes this exception. As long as the page has no custom tags, it is served fine. The same web-app works as expected in JBoss3.2.3/Tomcat4.x.
    It almost looks as if Tomcat is looking in a object pool for a custom tag object reference and when it fails to find one, throws a null-pointer instead of instantiating a new one to work with. (This is pure speculation on my part).
    Did the TLD's req's change, or the setup for Tomcat? It's not my tags, even Struts tags fail. Any ideas why my tags aren't "resolving"?

    Has anyone had any luck getting this to run or run into this problem? It fails even with a fresh JBoss install using tomcat 5.0.16.

  • Custom Tag issue and then ApplicationID?

    Hello,
    is there anybody out there who can help me with the following
    problem:
    I installed ColdFusion 4.5 Server on my Windows XP machine
    and wanted to access an already built CF application. When
    accessing
    the main default page, i got the following error:
    "Cannot find CFML template for custom tag
    CFA_APPLICATIONINITIALIZE.
    ColdFusion attempted looking in the tree of installed custom
    tags but
    did not find a custom tag with this name. "
    I copied the same Administrator settings, code and folders
    from the
    working production server to my local machine and it just
    doesn't seem
    to work. (I couldn't find any differences to the working
    application)
    I tried to fix it by copying the custom tag folder (located
    under allaire/spectra/customtags/) to C:\CFusion\CustomTags which
    somehow cleared the previous error but gave me the following new
    one:
    "Error Occurred While Processing Request > Error
    Diagnostic Information > This application can't be located by
    name. Use ApplicationID instead"
    Please, i appreciate any kind of comment on this post (i have
    been trying to fix this for the past 3 days!)
    Thanks,
    bbinto

    Spectra requires 4.5.1 or 5.
    Run the Spectra install to set up all the correct mappings
    and the webtop. Then copy over the custom application. It's been
    awhile since I've dug into the folder structure of the webtop, so I
    don't have a complete list of steps required for a Spectra app
    deployment. So you still have some work ahead of you.
    Just make sure you backup your database before the install,
    mirror it, or use a new schema for the installation and then switch
    over your datasources.
    I would recommend an old Spectra book you can probably find
    on eBay.
    http://www.forta.com/books/0789723654/

  • JSP Custom tag issues.

    Hi all,
    When my JAVA_HOME env variable is pointing to C:\jdk1.3, the JSP below which contains some custom tags fails to compile in Weblogic 5.1. However, when i change my JAVA_HOME env variable to C:\weblogic\jre1_2\jre, the same JSP compiles and deploys with no problems. I was of the opinion that the jre in jdk 1.3 is the same as jre1_2 which is bundled with weblogic 5.1. Does anyone know of any differences btw the Jre's or why the JSP below cannot be compiled when i use JDK1.3. Thanks for the help.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <%@ page import="java.util.Vector" %>
    <%@ page import="com.spcs.premiere.common.framework.errorhandling.ErrorUtility" %>
    <%@ page import="com.spcs.premiere.common.framework.errorhandling.PremiereLogger" %>
    <%@ page import="org.grnds.structural.web.GrndsServletException" %>
    <%@ taglib uri="/tlds/profiling/profile.tld" prefix="profile" %>
    <%@ page import="com.spcs.premiere.web.common.HTMLListBuilder" %>
    <%@ page import="com.spcs.premiere.web.common.ListParametersDomain" %>
    <%@ page import="com.spcs.premiere.web.common.PremiereConstants" %>
    <%@ page import="com.spcs.premiere.ejb.authentication.LoginDomain" %>
    <html>
    <head>
         <title>Premiere Business...Assign Credit Class</title>
         <LINK HREF="<%= request.getContextPath()%>/stylesheets/premiere.css" REL="stylesheet" TYPE="text/css">
         <SCRIPT LANGUAGE="javascript">
              var winHandle=window.dialogArguments;
         function userFocus()
              window.document.SupervisorLoginForm.SupervisorUserName.focus();
         </SCRIPT>
    </head>
    <body onload="userFocus();">
    <%
    try{
    %>
    <TABLE WIDTH="100%" HEIGHT="100%" CLASS="groupbox">
    <TR>
              <TABLE WIDTH="100%" HEIGHT="75%" CLASS="groupbox">
              <TR HEIGHT="15%"></TR>
              <FORM NAME="SupervisorLoginForm" ACTION="<%= request.getContextPath() %>/Premiere/AddAccountConversation/SupervisorLogin" METHOD="post" TARGET="_self">
    <TR HEIGHT="15%">
    <TD align=center><LABEL NAME="SupervisorUserNameLabel">User ID:</LABEL></TD></TD>
    <TD align=left><INPUT TYPE="text" NAME="SupervisorUserName" MAXLENGTH="20" SIZE="20" TABINDEX="1"></TD></TR>
              </TR>
              <TR>
    <TD align=center>    <LABEL NAME="SupervisorPasswordLabel">Password:</LABEL></TD></TD>
    <TD align=left><INPUT TYPE="password" NAME="SupervisorPassword" TABINDEX="2" MAXLENGTH="20" SIZE="20" ENABLED></TD>
              </TR>
              <TR>
              <TD COLSPAN="2" ALIGN="center"><BUTTON TYPE="submit" NAME="Login" TABINDEX="3" Class="button">Login</BUTTON></TD>
              <TD></TD>
              </TR></FORM>
              <FORM NAME="CreditClassForm" ACTION="<%= request.getContextPath() %>/Premiere/AddAccountConversation/AssignCreditManually" METHOD="post">
    <TR HEIGHT="60%">
    <TD align=center>        <LABEL NAME="SupervisorCreditClassLabel">Credit Class:</LABEL></TD></TD>
    <TD align=left>
              <profile:user WidgetName="CreditClass" Context="JSP" SubContext="SupervisorLogin" Evaluate="SUPERVISOR">
              <%= HTMLListBuilder.buildHTMLList((ListParametersDomain)session.getAttribute("CreditClassCodes")) %></TD>
              </profile:user>
              <TD></TD>          
              </TR>
              <TR></TR>
              </TR></TBODY></TABLE>
    </TR>
              <TR>
              <TABLE WIDTH="100%" HEIGHT="25%" CLASS="groupbox">
              <TD></TD>
              <TD align=right><BUTTON NAME="Cancel" Class="button" TABINDEX="4" ONCLICK="window.close()">Cancel</BUTTON>  
              <profile:user WidgetName="Save" Context="JSP" SubContext="SupervisorLogin" Evaluate="SUPERVISOR">
                   <BUTTON TYPE="submit" NAME="Save" TABINDEX="6" Class="button">Save</BUTTON>  
                   </profile:user>
              </TD>
              </TR></TBODY></TABLE>
              </TR></TBODY></TABLE>
              </FORM>
    <%
    catch (Exception e)
    LoginDomain loginDomain = (LoginDomain)session.getAttribute(PremiereConstants.LOGIN_DOMAIN);
    PremiereLogger.log( "ERROR", loginDomain.getUserName()+" General Exception Error: ", e );
    request.setAttribute(ErrorUtility.ERROR_CONDITION, ErrorUtility.getMessage(PremiereConstants.GENERIC_JSP_EXCEPTION_ERROR_ID) );
    throw new GrndsServletException();
    %>          
    </body>
    </html>

    UUh, interesting.
    Try to use the last Service Pack for 5.1 - i think it is sp9.
    Hope it'll work. I've had some problems with XML parsing but they resolved when I installed the last SP...

  • Custom tag lib, tomcat server cant parse descripter file

    Hi there, I'm working on custom tag libraries, and I have created a simple tag which prints a string when it is called from a jsp file. And I have created a descriptor file for that perticular tag and also created a jsp file which is using the tab lib that I have created, I have placed all these files in their corresponding files, well the problem is when I'm trying to call that jsp file it says the server can't parse the tags.tld file, because <urn></urn> must be declared. And can anybody throw some light on this! it would be much of help from you side, regards, Raasi
    I have pasted all the files with the error message please have a look
    ************** Descriptor file ****************88
    <?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>
         <!-- after this the default space is "http://java.sun.com/j2ee/dtds/jsptaglibrary_1_2.dtd" -->
         <tlibversion>1.0</tlibversion>
         <jspversion>1.1</jspversion>
         <shortname>csajsp</shortname>
         <urn></urn> <!-- problem is here. -->
         <info>
              A tag library from Core Servlets and JavaServer Pages, http://www.coreservlets.com/.
         </info>
         <tag>
              <name>example</name>
              <tagclass>coreservlets.tags.ExampleTag</tagclass>
              <info>Simplest example: inserts one line of output</info>
              <bodycontent>EMPTY</bodycontent>
         </tag>
         <!-- Other tags defined later... -->
    </taglib>
    The JSP file which is using that descriptor file
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <%@ taglib uri="csajsp-taglib.tld" prefix="csajsp" %>
    <TITLE><csajsp:example /></TITLE>
    <LINK REL=STYLESHEET HREF="JSP-Styles.css" TYPE="text/css">
    </HEAD>
    <BODY>
    <H1><csajsp:example /></H1>
    <csajsp:example />
    </BODY>
    </HTML>
    error message from Tomcat4.1 server
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: XML parsing error on file /jsp/csajsp-taglib.tld: (line 9, col 7): Element type "urn" must be declared.
         at org.apache.jasper.xmlparser.ParserUtils.parseXMLDocument(ParserUtils.java:189)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:247)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:183)
         at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:354)
         at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:799)
         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:219)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:323)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:471)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
         at java.lang.Thread.run(Thread.java:536)
    Apache Tomcat/4.1.12
    ********************************8

    Hi,
    I have used the following dtd file for a simple tag you can use it by just replacing the tag properties
    <?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/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
    <taglib>
         <tlib-version>1.0</tlib-version>
         <jsp-version>1.2</jsp-version>
         <short-name>CooperatingTags</short-name>
         <description>
         </description>
         <tag>
              <name>first</name>
              <tag-class>com.opera.tagclasses.FirstTag</tag-class>
              <body-content>EMPTY</body-content>
              <attribute>
                   <name>sessionID</name>
                   <required>false</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
         </tag>
    </taglib>
    I guess tag urn is not required.
    Hope this helps
    Ravi

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

  • Tomcat 4.1.12 and custom tags with body

    Hi,
    I had deployed one application in tomcat 3.3.1 which used custom tags with body, and it worked fine, However recently I upgraded that application to tomcat-4.1.12
    and the tags with body stopped giving expected behaviour, however the tags without body are giving expected behaviour, I had a look at generated jsp file...
    I am pasting the generated output here
    jp.co.nttdata.sk._webtier.tagext.FormTag jspxth_sk_form_0 = (jp.co.nttdata.sk._webtier.tagext.FormTag) jspxtagPool_sk_form_action.get(jp.co.nttdata.sk._webtier.tagext.FormTag.class);
    jspxth_sk_form_0.setPageContext(pageContext);
    jspxth_sk_form_0.setParent(null);
    jspxth_sk_form_0.setAction(SKScreenDefinition.SK_I0100 );
    int jspxeval_sk_form_0 = jspxth_sk_form_0.doStartTag();
    if (_jspx_eval_sk_form_0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
    if (_jspx_eval_sk_form_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
    javax.servlet.jsp.tagext.BodyContent _bc = pageContext.pushBody();
    _bc.clear();
    out = _bc;
    jspxth_sk_form_0.setBodyContent(_bc);
    jspxth_sk_form_0.doInitBody();
    do {
    out.write("\r\n<input type=\"hidden\" name=\"rpt_no\" value=\"<%= rpt_no %>\">\r\n<input type=\"hidden\" name=\"optnOpen\" value=\"0\">\r\n<table border=0 cellspacing=0 cellpadding=0 class=\"bdsyl\">\r\n<tr>\r\n<td class=\"innframe\">\r\n\r\n\t<table border=0 cellspacing=0 cellpadding=5 class=\"bgcol_1\">\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������E/td>\r\n\t<td>\r\n\t\t\t<select name=\"rptDivCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOskCodeNameRptDiv != null) nLen = arrOskCodeNameRptDiv.length;\r\n%>\r\n<%\r\n\tfor(int i=0;i<nLen;i++) \r\n\t{\r\n\t\tString cd = arrOskCodeNameRptDiv.getCode();\r\n\t\tString nm = arrOskCodeNameRptDiv[i].getName();\r\n\t\tString value = cd + SKConstants.SEPARATOR + nm;\r\n\r\n\t\tstrSelected = \"\";\r\n\t\tif(cd.equals(rpt_div)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%=value%>\"><%= nm%></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ��� ���E���</td>\r\n\t<td>\r\n\t\r\n\t\t\t<select name=\"prortyCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOskCodeNameProrty != null) nLen = arrOskCodeNameProrty.length;\r\n");
    out.write("%>\r\n<%\r\n\tfor(int i=0;i<nLen;i++) \r\n\t{\r\n\t\tString cd = arrOskCodeNameProrty[i].getCode();\r\n\t\tString nm = arrOskCodeNameProrty[i].getName();\r\n\t\tString value = cd + SKConstants.SEPARATOR + nm;\r\n\r\n\t\tstrSelected = \"\";\r\n\t\tif(cd.equals(prorty)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= value %>\"><%= nm %></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\t\r\n\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������E/td>\r\n\t<td><input type=\"text\" size=4 maxlength=4 name=\"rpt_dt_yyyy\" value=\"<%= rpt_dt_yyyy %>\">��� <input type=\"text\" size=2 maxlength=2 name=\"rpt_dt_mm\" value=\"<%= rpt_dt_mm %>\">���E<input type=\"text\" size=2 name=\"rpt_dt_dd\" maxlength=2 value=\"<%= rpt_dt_dd %>\">��� <input type=\"text\" maxlength=2 size=2 name=\"rpt_dt_hh\" value=\"<%= rpt_dt_hh %>\">���E<input type=\"text\" size=2 maxlength=2 name=\"rpt_dt_mi\" value=\"<%= rpt_dt_mi %>\">���E<span class=\"fsyl_2\">�E����������������E/span></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ��� ���E���E</td>\r\n\t<td><input type=\"text\" size=20 name=\"rpt_user\" value=\"<%= Util.forHidden(rpt_user) %>\"></td>\r\n");
    out.write("\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������������E/td>\r\n\t<td>\r\n\t\r\n\t\t\t<select name=\"rptRegiUserCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOfUserName != null) nLen = arrOfUserName.length;\r\n\r\n\tfor(int i=0;i<nLen;i++){\r\n\t\tString[] arrTemp = UzUtil.extractTokens(arrOfUserName[i], SKConstants.SEPARATOR);\r\n\t\t\r\n\t\tstrSelected = \"\";\r\n\t\tif(arrTemp[0].equals(rpt_regi_user)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= arrOfUserName[i] %>\"><%= arrTemp[1] %></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\r\n\t\r\n\t</td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������������</td>\r\n\t<td><input type=\"text\" size=70 name=\"rpt_title\" value=\"<%= UzString.forHidden(rpt_title)%>\"> <span class=\"fsyl_2\">�E�E00���E�����E/span></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ��������E���</td>\r\n\t<td nowrap><textarea wrap=\"physical\" rows=10 cols=72 name=\"rpt_txt\"><%= UzString.htmlEncodeForHidden(rpt_txt) %></textarea> <span class=\"fsyl_2\">�E�E000���E�����E/span>      </td>\r\n");
    out.write("\t</tr>\r\n\t<tr>\r\n\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������E��</td>\r\n\t<td><textarea rows=5 cols=72 name=\"rpt_effct_lmt\"><%= UzString.htmlEncodeForHidden(rpt_effct_lmt) %></textarea> <span class=\"fsyl_2\">�E�E00���E�����E/span></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���E��� ���</td>\r\n\t<td><textarea rows=5 cols=72 name=\"reappr_cnd\"><%= UzString.htmlEncodeForHidden(reappr_cnd)%></textarea> <span class=\"fsyl_2\">�E�E00���E�����E/span></td>\r\n\t</tr>\r\n\t<tr>\r\n\t<td nowrap class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������������E/td>\r\n\t<td><input type=\"text\" size=4 name=\"rply_prf_dt_yyyy\" maxlength=4 value=\"<%= rply_prf_dt_yyyy %>\">��� <input type=\"text\" size=2 name=\"rply_prf_dt_mm\" maxlength=2 value=\"<%= rply_prf_dt_mm %>\">���E<input type=\"text\" maxlength=2 size=2 name=\"rply_prf_dt_dd\" value=\"<%= rply_prf_dt_dd %>\">��� <input type=\"text\" maxlength=2 size=2 name=\"rply_prf_dt_hh\" value=\"<%= rply_prf_dt_hh %>\">���E<input type=\"text\" maxlength=2 size=2 name=\"rply_prf_dt_mi\" value=\"<%= rply_prf_dt_mi %>\">���E<span class=\"fsyl_2\">�E����������������E/span></td>\r\n");
    out.write("\t</tr>\r\n\t<tr>\r\n\t<td>���</td>\r\n\t<td align=right><input type=\"button\" value=\"���������������\" onClick=\"openOptn()\"></td>\r\n\t</tr>\r\n<!---- ��������������������������������������� ----->\r\n\t<tr id=\"com\" style=\"display:none\">\r\n\t<td colspan=2>\r\n\t\t<table border=0 cellspacing=0 cellpadding=5>\r\n\t\t<tr>\r\n\t\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������������E/td>\r\n\t\t<td>\r\n\t\t\t<select name=\"crrspndUserCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOfUserName != null) nLen = arrOfUserName.length;\r\n\r\n\tif(crrspnd_user.equals(\"\")) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= SKConstants.NOTSPECIFIED %>\">���������������������E/option>\r\n<%\r\n\tfor(int i=0;i<nLen;i++){\r\n\t\tString[] arrTemp = UzUtil.extractTokens(arrOfUserName[i], SKConstants.SEPARATOR);\r\n\t\t\r\n\t\tstrSelected = \"\";\r\n\t\tif(arrTemp[0].equals(crrspnd_user)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= arrOfUserName[i] %>\"><%= arrTemp[1] %></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\t\t\r\n\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������������E/td>\r\n");
    out.write("\t\t<td>\r\n\t\t\t<select name=\"fndngDivCombo\">\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOskCodeNameFndngDiv != null) nLen = arrOskCodeNameFndngDiv.length;\r\n\r\n\tif(fndng_div.equals(\"\")) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= SKConstants.NOTSPECIFIED %>\">���������������������E/option>\r\n<%\r\n\tfor(int i=0;i<nLen;i++) \r\n\t{\r\n\t\tString cd = arrOskCodeNameFndngDiv[i].getCode();\r\n\t\tString nm = arrOskCodeNameFndngDiv[i].getName();\r\n\t\tString value = cd + SKConstants.SEPARATOR + nm;\r\n\r\n\t\tstrSelected = \"\";\r\n\t\tif(cd.equals(fndng_div)) strSelected = \"selected\";\r\n%>\r\n\t\t\t\t<option <%= strSelected %> value=\"<%= value %>\"><%= nm %></option>\r\n<%\r\n\t}//for loop\r\n%>\r\n\t\t\t</select>\r\n\t\t\r\n\t\t</td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������E��������</td>\r\n\t\t<td><input type=\"text\" maxlength=4 size=4 name=\"crrspnd_fin_pln_dt_yyyy\" value=\"<%= crrspnd_fin_pln_dt_yyyy %>\">��� <input type=\"text\" maxlength=2 size=2 name=\"crrspnd_fin_pln_dt_mm\" value=\"<%= crrspnd_fin_pln_dt_mm %>\">���E<input maxlength=2 type=\"text\" size=2 name=\"crrspnd_fin_pln_dt_dd\" value=\"<%= crrspnd_fin_pln_dt_dd %>\">��� <span class=\"fsyl_2\">�E����������������E/span></td>\r\n");
    out.write("\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������E��</td>\r\n\t\t<td><input type=\"text\" maxlength=4 size=4 name=\"crrspnd_fin_dt_yyyy\" value=\"<%= crrspnd_fin_dt_yyyy %>\">��� <input type=\"text\" maxlength=2 size=2 name=\"crrspnd_fin_dt_mm\" value=\"<%= crrspnd_fin_dt_mm %>\">���E<input type=\"text\" size=2 maxlength=2 name=\"crrspnd_fin_dt_dd\" value=\"<%= crrspnd_fin_dt_dd %>\">��� <span class=\"fsyl_2\">�E����������������E/span></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������</td>\r\n\t\t<td><textarea rows=8 cols=72 name=\"cause_txt\"><%= UzString.htmlEncodeForHidden(cause_txt) %></textarea> <span class=\"fsyl_2\">�E�E000���E�����E/span></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������E��</td>\r\n\t\t<td><textarea rows=10 cols=72 name=\"crrspnd_txt\"><%= UzString.htmlEncodeForHidden(crrspnd_txt) %></textarea> <span class=\"fsyl_2\">�E�E000���E�����E/span></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ���������������E/td>\r\n\t\t<td><textarea rows=8 cols=72 name=\"rlps_prvnt_schm\"><%= UzString.htmlEncodeForHidden(rlps_prvnt_schm) %></textarea> <span class=\"fsyl_2\">�E�E000���E�����E/span></td>\r\n");
    out.write("\t\t</tr>\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n<!---- ��������������������������������������� ���E----->\r\n\t<tr>\r\n\t<td valign=top class=\"fsyl_1\"><font class=\"fsyl_6\">���</font> ������������������E/td>\r\n\t<td>\r\n\t\t<table border=0 cellspacing=0 cellpadding=0>\r\n\t\t<tr valign=top>\r\n\t\t<td><input type=\"radio\" name=\"mail_sendto_div_radio\" checked onClick=\"mailCheck(true)\" value=\"<%= SKConstants.CD_ONE + SKConstants.SEPARATOR + \"������\" %>\">��������������� <input type=\"radio\" name=\"mail_sendto_div_radio\" onClick=\"mailCheck(false)\" value=\"<%= SKConstants.CD_ZERO + SKConstants.SEPARATOR + \"���������E��\" %>\">���������E��Enbsp; </td>\r\n\t\t<td>\r\n<%\r\n\tstrSelected = \"\";\r\n\tnLen = 0;\r\n\tif(arrOskCodeNameGroup != null) nLen = arrOskCodeNameGroup.length;\r\n\tint nExtra = (nLen/2) + (nLen%2);\r\n%>\r\n<%\r\n\tfor(int i=0;i<nLen;i++) \r\n\t{\r\n\t\tString cd = arrOskCodeNameGroup[i].getCode();\r\n\t\tString nm = arrOskCodeNameGroup[i].getName();\r\n\t\tString value = cd + SKConstants.SEPARATOR + nm;\r\n%>\r\n\t\t\t\t<input type=\"checkbox\" name=\"send_mail\" value=\"<%= value %>\"><%= nm %><br>\r\n<%\r\n\t\tif((i+1) == nExtra)\r\n\t\t{\r\n%>\r\n\t\t\t</td>\r\n\t\t\t<td>    </td>\r\n");
    out.write("\t\t\t<td>\r\n<%\r\n\t\t}\r\n\t}//for loop\r\n%>\r\n\t\t</td>\r\n\t\t</tr>\r\n\t\t</table>\r\n\t</td>\r\n\t</tr>\r\n\t<td>���</td>\r\n\t<td align=right><br><input type=\"submit\" value=\"������������\" name=\"saveReport\">���<input type=\"submit\" value=\"���������������������\" name=\"regReport\"></td>\r\n\t</tr>\r\n\t</table>\r\n\r\n</td>\r\n</tr>\r\n</table>\r\n");
    int evalDoAfterBody = jspxth_sk_form_0.doAfterBody();
    if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
    break;
    } while (true);
    if (_jspx_eval_sk_form_0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
    out = pageContext.popBody();
    What I found out that scriptlets are also encluded in string however they should not be enclosed.
    Is it a bug? or do I need to change my taghandler class...?
    Any suggestion, any help ll be really helpful
    Regards,
    Susheel

    Hi,
    I am able to resolve it,
    Actually I was using the body content as tagdependent instead of jsp.
    However the body content tagdependent works in Tomcat 3.3.1 and weblogic 5.1, 6.0.
    Anyway...

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

  • Confusing execution sequence in Custom tag

    I have a custom tag file with the name make_red.cfm that
    makes a text passed to it to the color red.
    The calling code looks like this:
    Main page<br>
    <cf_make_red result="myVar">
    Dont mess with the Zohan!!!
    </cf_make_red>
    back to the main page<br>
    The code in make_red.cfm looks something like this:
    <cfoutput>
    <hr>
    ThisTag.ExecutionMode is #ThisTag.ExecutionMode#<br>
    ThisTag.GeneratedContent is
    #ThisTag.GeneratedContent#<br>
    <hr>
    <cfif ThisTag.ExecutionMode IS "Start">
    Tag start<br>
    <cfif structkeyexists(attributes,"result")>
    <cfset evaluate("caller.#attributes.result# =
    ""CUSTOM_TAG_COMPLETED""")>
    </cfif>
    Tag processing<br>
    <cfelseif ThisTag.ExecutionMode IS "End">
    Tag processed<br>
    <cfset ThisTag.GeneratedContent = "<font
    color=""red"">"&ThisTag.GeneratedContent&"</font><br>">
    The tag ends here<br>
    </cfif>
    </cfoutput>
    The output looks like this:
    Main page
    ThisTag.ExecutionMode is start
    ThisTag.GeneratedContent is
    Tag start
    Tag processing
    Dont mess with the Zohan!!!
    ThisTag.ExecutionMode is end
    ThisTag.GeneratedContent is Dont mess with the Zohan!!!
    Tag processed
    The tag ends here
    back to main page
    My question is this:
    As per the sequence of the statements in the custom tag code,
    the text that appears in the beginning of tag file will be printed
    after which the processing for the end tag happens in the
    <cfif>. The text passed between the <cf_make_red> and
    </cf_make_red> i.e. "Dont mess with the Zohan!!!" appears to
    be printing before the end tag executes.
    Shouldnt the text passed between the <cf_make_red> and
    </cf_make_red> come after the end tag is processed? Because
    thats where i am making the text red.
    Could someone please explain this?

    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.

  • Custom Tag Capitalization Problem..

    All,
              OS: Windows 2000
              App Server: Weblogic 6.0 sp 2
              JDK: 1.3 (and tried 1.3.1)
              I have a set of custom tags that run fine when I use them on an app server (such as Enhydra) with JDK 1.2.2, but when I switch to JDK 1.3.x, which weblogic 6.x requires, they suddenly start generating errors with attributes which have capitalized letters in them. For example, in my taglib I have:
              <attribute>
              <name>closeConnection</name>
              <required>false</required>
              <rtexprvalue>true</rtexprvalue>
              </attribute>
              and in the support class I have:
              * Get the value of closeConnection.
              * @return value of closeConnection.
              public boolean getCloseConnection() {
              return closeConnection;
              * Set the value of closeConnection.
              * @param v Value to assign to closeConnection.
              public void setCloseConnection(String v) {
              if(v.toUpperCase().equals("TRUE")){
              this.closeConnection = true;
              } else {
              this.closeConnection = false;
              When I go to the page that this tag is on, I get the following output:
              Parsing of JSP File '/index.jsp' failed:
              /index.jsp(1): Error in using tag library uri='/cwerks' prefix='cwerks': There is no setter method for property 'closeconnection', for Tag class 'net.cwerks.taglib.MyTag'
              probably occurred due to an error in /index.jsp line 1:
              <%@ taglib uri="/cwerks" prefix="cwerks" %>
              Thu Aug 02 19:06:52 PDT 2001
              Note that the 'closeconnection' is all lowercase despite the fact that it is upper case in the tld and in the class itself.
              I came across a similar problem in weblogic 5.1 when I upgraded from JDK 1.2.2 to JDK 1.3. I tried changing the JDK for weblogic 6.0 sp 2 to 1.2.2, but a dll was missing. I also tried switching it to 1.3.1, but that did not help. It seems like introspection may have changed slightly between the two version. I'm shocked, and a bit suspicious, that I haven't seen this problem all over the newsgroups. Anyone else seen this?
              Thank you,
              Carson Gross
              [email protected]
              [att1.html]
              

    A solution presents itself:
              The problem was NOT with capitalization. Instead, the problem was as
              follows:
              My method was for setting a boolean, but I took a string so that people
              wouldn't have to type:
              <mytags:tag foo="<%=true%>" />
              instead, they could type:
              <mytags:tag foo="true" />
              which would call the setter method with a string "true", which would be then
              converted to a boolean within my class.
              So my setter has this signature:
              public void setFoo(String s)
              and my getter has this signature:
              public boolean getFoo() /* I know this isn't standard, but isFoo doesn't
              sound good to me*/
              I can't tell if it's because JavaBeans changed slightly between jdk 1.2.2
              and 1.3.x, or if Weblogic changed the way that they do things (I suspect the
              latter, since I had things working fine in WL 5.2 w/ jdk 1.2.2 and then
              things broke with WL 5.2 w/ jdk 1.3), but this no longer returns foo as a
              valid property to be set, and since weblogic 6.x relies on JavaBeans,
              instead of straight up introspection, it barfs. (I found this out by using
              jad/emacs, a wicked combination for those who want to poke around in jars).
              Anyway, I hope I can save someone else who has this same, albeit
              specialized, problem a lot of pain by my discovery. Your getters and
              setters better be of the same type with custom tags, or weblogic w/ jdk1.3.x
              is gonna barf when parsing the tld.
              Cheers, and thank God that's behind me,
              Carson Gross
              [email protected]
              ====================================================
              "Carson Gross" <[email protected]> wrote in message
              news:[email protected]...
              The plot grows thicker...
              The tags work fine on Tomcat 3.2.2
              I deploy the example tags that came with wl60 that have more than one
              capital letter in thier attributes, and they work fine. But my tag library
              stubbornly insists on not working so long as I keep the attributes with more
              than one capital letter in. If I remove the offending attributes, or change
              them to have only one capital letter, they work, but this is not an
              acceptable solution. (I guess.)
              I even created an simple introspection class to make sure that the acutal
              methods were there. They were.
              I am at a complete loss here... I guess it's tomcat for now.
              Cheers,
              Carson Gross
              [email protected]
              "Carson Gross" <[email protected]> wrote in message
              news:[email protected]...
              All,
              OS: Windows 2000
              App Server: Weblogic 6.0 sp 2
              JDK: 1.3 (and tried 1.3.1)
              I have a set of custom tags that run fine when I use them on an app server
              (such as Enhydra) with JDK 1.2.2, but when I switch to JDK 1.3.x, which
              weblogic 6.x requires, they suddenly start generating errors with attributes
              which have capitalized letters in them. For example, in my taglib I have:
              <attribute>
              <name>closeConnection</name>
              <required>false</required>
              <rtexprvalue>true</rtexprvalue>
              </attribute>
              and in the support class I have:
              * Get the value of closeConnection.
              * @return value of closeConnection.
              public boolean getCloseConnection() {
              return closeConnection;
              * Set the value of closeConnection.
              * @param v Value to assign to closeConnection.
              public void setCloseConnection(String v) {
              if(v.toUpperCase().equals("TRUE")){
              this.closeConnection = true;
              } else {
              this.closeConnection = false;
              When I go to the page that this tag is on, I get the following output:
              Parsing of JSP File '/index.jsp' failed:
              /index.jsp(1): Error in using tag library uri='/cwerks' prefix='cwerks':
              There is no setter method for property 'closeconnection', for Tag class
              'net.cwerks.taglib.MyTag'
              probably occurred due to an error in /index.jsp line 1:
              <%@ taglib uri="/cwerks" prefix="cwerks" %>
              Thu Aug 02 19:06:52 PDT 2001
              Note that the 'closeconnection' is all lowercase despite the fact that it is
              upper case in the tld and in the class itself.
              I came across a similar problem in weblogic 5.1 when I upgraded from JDK
              1.2.2 to JDK 1.3. I tried changing the JDK for weblogic 6.0 sp 2 to 1.2.2,
              but a dll was missing. I also tried switching it to 1.3.1, but that did not
              help. It seems like introspection may have changed slightly between the two
              version. I'm shocked, and a bit suspicious, that I haven't seen this
              problem all over the newsgroups. Anyone else seen this?
              Thank you,
              Carson Gross
              [email protected]
              

  • How to use JSP custom tag lib in PAR file?

    Hi All,
    I am trying to customize mastheaderpar file. For that I have downloaded relevant par file and making the changes accordingly.
    As part of the changes I would require to use JSP custom tag library in my par file.
    I have the TLD file and relevant classes in the jar file. I would like to know where and what kind of modifications have to be done to use the jsp custom tag library.
    I tried modifying some things in portalapp.xml but was not successful.
    Please help me on how to proceed with this? It would be great if you can provide the xml entry to use this tag library
    Thanks
    Santhosh

    Hi Johny,
    Thanks for the reply. Actually I am able to change colors etc. with out any problem.
    My requirement is to use XMLTaglib in mastheader par file. This tag lib is from apache tomcat. I have the relevant TLD and class files. I copied TLD file into taglib dir of portal-inf and class file in src api.
    And I have added the following line in portalapp.xml under component-profile section of default
    <property name="tlxtag" value="/SERVICE/Newmastheader/taglib/taglibs-xtags.tld">
    Is this the right way to use tag lib? Actually before adding this line I used to get the error saying "Error parsing taglib", but now the error does not occur and I am getting new error. This is an exception in one of the taglib classes.
    Could any one provide me some inputs on how to check this error?
    Thanks
    Santhosh

  • JSP Custom Tags, Tag Handlers, Passing values

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

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

  • Where does the jar for a custom tag libary need to go?

    I am having trouble getting a custom tag library's classes found. These are located
    in a jar file called blazix.jar.
    I have the following GetName.jsp:
    <%@ taglib prefix="blx" uri="/blx.tld" %>
    <jsp:directive.page import="com.company.project.ejb.UserData"/>
    <jsp:useBean id="user" class="UserData" scope="session"/>
    <HTML>
         <BODY>
              <blx:getProperty name="user" property="*">
              <FORM METHOD=POST ACTION="SaveName.jsp">
                   What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
                   What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
                   What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
                   <P><INPUT TYPE=SUBMIT>
              </FORM>
              </blx:getProperty>
         </BODY>
    </HTML>
    When I run this, I get the following:
    Parsing of JSP File '/GetName.jsp' failed:
    /GetName.jsp(1): Error in using tag library uri='/blx.tld' prefix='blx': cannot
    find tag class: 'desisoft.jsp.tagext.SetProp'
    probably occurred due to an error in /GetName.jsp line 1:
    <%@ taglib prefix="blx" uri="/blx.tld" %>
    The jar does contain the needed class (desisoft.jsp.tagext.SetProp), but how can
    I tell WebLogic where to find it?
    In other words, what directory does the blazix.jar need to go under? I tried
    adding it to my classpath but that did not help.
    Thanks!

    I got it. Just needed to add my own lib directory under WEB-INF and copy the jar
    to it.
    Question though, why wouldn't this get generated for me? Would think it would
    be a common thing to need.
    "Darrin" <[email protected]> wrote:
    >
    BTW,
    I placed the blx.tld file under the WEB-INF directory. It seems to find
    it OK
    there at least.
    "Darrin" <[email protected]> wrote:
    I am having trouble getting a custom tag library's classes found. These
    are located
    in a jar file called blazix.jar.
    I have the following GetName.jsp:
    <%@ taglib prefix="blx" uri="/blx.tld" %>
    <jsp:directive.page import="com.company.project.ejb.UserData"/>
    <jsp:useBean id="user" class="UserData" scope="session"/>
    <HTML>
         <BODY>
              <blx:getProperty name="user" property="*">
              <FORM METHOD=POST ACTION="SaveName.jsp">
                   What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
                   What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
                   What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
                   <P><INPUT TYPE=SUBMIT>
              </FORM>
              </blx:getProperty>
         </BODY>
    </HTML>
    When I run this, I get the following:
    Parsing of JSP File '/GetName.jsp' failed:
    /GetName.jsp(1): Error in using tag library uri='/blx.tld' prefix='blx':
    cannot
    find tag class: 'desisoft.jsp.tagext.SetProp'
    probably occurred due to an error in /GetName.jsp line 1:
    <%@ taglib prefix="blx" uri="/blx.tld" %>
    The jar does contain the needed class (desisoft.jsp.tagext.SetProp),
    but how can
    I tell WebLogic where to find it?
    In other words, what directory does the blazix.jar need to go under?
    I tried
    adding it to my classpath but that did not help.
    Thanks!

  • EL expressions not evaluated in custom tag attribute

    I'm writing a custom tag implementation where I need to have some attribute values
    dynamically evaluated using EL, such that I can write:
    <mytaglib:mytag id="${somevar}"/>
    I cannot seem to accomplish this, however. My taglib tag definition looks like this:
         <tag>
              <name>mytag</name>
              <tag-class>myclass</tag-class>
              <body-content>empty</body-content>
              <description>
    Foo
              </description>
              <attribute>
                   <name>articleId</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
                   <type>java.lang.String</type>
              </attribute>
         </tag>
    The implementation of myclass extends TagSupport (since I need to get at the PageContext). The setArticleId() method looks like this:
    public void setArticleId(String idStr) throws JspException {
    if (logger.isDebugEnabled()) {
    logger.debug("idStr = " + idStr);
    try {
    /* XXX: Somehow, the evaluation should happen automagically, but
    * I can't figure out why that doesn't happen!
    String articleIdStr = (String)pageContext.getExpressionEvaluator().evaluate(
    idStr,
    java.lang.String.class, pageContext.getVariableResolver(), null);
    this.articleId = Integer.parseInt(articleIdStr);
    } catch (ELException e) {
    throw new JspException("Failed to parse article id expression");
    Why does it not work automagically?

    Make sure you are working with a JSP 2 container (like Tomcat 5). Also, you should make sure that your web.xml is configured to use the newest Servlet Spec. Read reply #6 on: http://forum.java.sun.com/thread.jspa?threadID=629437 to make sure it is set up properly.
    If you are not using a JSP 2.0 container, then you will not be able to use EL in your custom tag. See: http://forum.java.sun.com/thread.jspa?forumID=45&threadID=725503 for alternatives.

  • Custom Tag Library - error in IWS

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

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

Maybe you are looking for

  • Mac Mini with Major Problems

    I'll try to make this short, but it is a looonngg problem. About one month ago my Mac Mini began having problems when I boot up.  The computer would freeze on the opening page where I put in my password.  My wireless keyboard and trackpad would not w

  • Cost Center in SRM

    Hi Friends, In which database table the cost centers are stored in srm? Thanks, Atanu

  • My questions aren't getting posted

    i wanted to post a question about people experience with macbook pro reitna but after a few minutes they weren't there. any ideas?

  • Long running procedure

    Hi all. I have one problem with OracleCommand When I try to execute long running command, ASP.Net stoping work ocom.Parameters.Add("i_map",OracleDbType.Int32,1,System.Data.ParameterDirection.Input); ocom.ExecuteReader(); //at this staitment ASP.Net b

  • Buisness Event not raised from People/Assignment screen?

    I found a seeded Business Event for People/Assignment screen : oracle.apps.per.api.assignment.update_emp_asg. So, i went and added subsription to it and then tested it. It works fine from Business Event Test page(html framework). However, when i did