JSP 2.0 Tag files outputting elements with conditional attributes

It appears to be impossible to conditionally output element-attributes in JSP 2.0 XML Tag files. Here's an example:
Tagfile text.tagx:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
  <jsp:directive.attribute name="name" required="true" type="java.lang.String"/>
  <jsp:directive.attribute name="id" required="false" type="java.lang.String"/>
  <jsp:text>
    <input type="text" name="${name}" id="${id}" />
  </jsp:text>
</jsp:root>Seems simple enough. This tag has a name-attribute and an optional id-attribute. But what if I want the id-attribute of the 'input' element not to be outputted when the id-parameter is empty!
It appears there's no elegant way to do this but to revert to CDATA blocks and/or output-escaping. Is this an oversight in the API or am I missing something?
I've also tried the following but it didn't work (in Tomcat anyway):
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2" xmlns:c="http://java.sun.com/jsp/jstl/core">
  <jsp:directive.attribute name="name" required="true" type="java.lang.String"/>
  <jsp:directive.attribute name="id" required="false" type="java.lang.String"/>
  <jsp:text>
    <jsp:element name="input">
      <jsp:attribute name="type" value="text"/>
      <jsp:attribute name="name" value="${name}"/>
      <c:if test="${!empty id}">
        <jsp:body>
          <jsp:attribute name="id" value="${id}"/>
        </jsp:body>
      </c:if>
    </jsp:element>
  </jsp:text>
</jsp:root>Any ideas on how to do this?

I wonder why no one has responded to this post!!!! I am trying to do the same thing, to no avial. In XSLT this is how it works, I would have thought JSTL would do the same thing. D'oh!

Similar Messages

  • Prob in  working with jsp 2.0 tags fil

    hi all
    i am facing a prob working with jsp 2.0 tags files and hope to receive a possitive responce from your good self:-
    <p>
    how could i create a instance of a user defined class in a tags files .
    <p>eg.
    <tb:firsttag tableName="customer" className="createtable" packagename="package1">
    <BR>
    </tb:firsttag>
    what code i have to write in tag file to create a object of class createtable </br>
    thanks in advance, waiting for ur cooperation

    I'm not sure I understand your question, but...
    If you want to create a custom tag that will contain a body (data between the start and end tags) you will extend BodyTagSupport.
    HTH.

  • [weblogic-9.1] JSP 2.0 tag file gets compiled but not reloaded

    I am trying to use a JSP 2.0 tag file on weblogic 9.1. Everything works as expected until I reload the page after changing the tag file. Consider the following files, simple.jsp and simple.tag:
    h5. /simple.jsp
    &lt;%@ page language="java" %&gt;
    &lt;%@ taglib prefix="sandbox" tagdir="/WEB-INF/tags" %&gt;
    &lt;html&gt;
    &lt;body&gt;
    This output comes from the jsp.
    &lt;sandbox:simple&gt;
    &lt;/sandbox:simple&gt;
    &lt;/body&gt;
    &lt;/html&gt;h5. /WEB-INF/tags/simple.tag
    &lt;%@ tag language="java" %&gt;
    <div>This output comes from a tag file
    </div>The output of a call to simple.jsp is:
    <html><head>
    </head><body>
    This output comes from the JSP.
    <div>This output comes from a tag file</div>
    </body></html>So far, so good. Now I change the content of simple.tag to
    <%@ tag language="java" %>
    <div>This output comes from *simple.tag*<div>On a new call to simple.jsp,
    1. Weblogic notices that the file has been changed,
    2. generates the TagHandler .java file
    3. compiles the .java file
    But the new class file seems not to be loaded by weblogic; the resulting HTML does not change. It is not a browser cache issue, as I can see Javelin compilation errors. E.g., changing the tag file content to
    <%@ tag language="j" %>
    <div>This output comes from simple.tag</div>leads to the following (expected) error:
    Compilation of JSP File '/sandbox/simple.jsp' failed:
    simple.tag:1:18: "j" is not a valid setting for the language attribute.
    <%@ tag language="j" %>
    ^-^
    Changes to the .jsp file are reflected in the HTML output.
    Am I missing something? Is there any flag I have to set in my weblogic configuration?

    You are right in saying that decoding has nothing to
    do with rendering per se.I will go even further than Erik did, and dispute this statement.
    Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
    The "renderer" really does
    two completely different things. But both should
    nevertheless be separate from the component
    implementation itself. You could still have the
    renderer doing the decoding part, which arguably would
    rarely change, and somehow delegate the actual
    rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
    Craig

  • JSP 2.0 tag files in jDeveloper 10g

    Hi, I'd like to create a set of UI components using JSP 2.0 tag files and have them available through the jDeveloper component palette for use in the visual edittor. I'd like jDeveloper to render the tags at design time like it can with regular old tags.
    Can this be done, and if so, how? I poked around in jDeveloper and on the web site without figuring it out... If I missed something obvious or there's docs online please point me in the right direction!
    Thanks,
    L.

    OK, so the integrated run-time supports JSP 2.0 and tag files. But what I'm after is support in the design-time components. Specifically, I want to produce a set of user interface components that I can place in the component palette and have rendered in the JSP visual editor.
    As far as I can tell (see previous post), jDeveloper's editor doesn't understand JSP 2.0 features. Therefore I suspect that the design-time as a whole doesn't and so I'll have to use regular Java tags for anything that needs to be able to be rendered at design time.
    Oh well. Maybe I can write a Java tag implementation that somehow invokes a tag file and just write a simple wrapper taglib specifically for use within jDeveloper at design time.
    L.

  • JSP 2.x - Tag files with body-content="JSP"

    I've been looking at the JSP 2.1 draft and see that, as with the previous JSP release, it is not allowed for tag-files to have body-content="JSP". I've tried to find a good answer for that on the web, but there's no one who can enlighten me. I've tried to tweak the source of Apache Tomcat 6.0.13 (Validator.ValidateVisitor and TagFileProcessor.TagFileDirectiveVisitor, both in org.apache.jasper.compiler) to accept body-content="JSP" in tag files - with great success. It is possible to have scriptlets within tags from tag files and it works as expected.
    My reason for wanting scriptlets in the body-content of tags from tag files is that it would encourage a more contextual, nested (and in my eyes, a more beautiful) structure of JSP-pages, as opposed to the JSTL flat structure, where f.ex. the sql:query tag does not reside within a sql:setDataSource tag, but instead refers to the datasource through an EL-variable. I suppose that it has been constructed in this way only to make it possible for programmers to include scriptlets in-between sql:query tags that use the same datasource.
    Not that it is not possible to nest tag-file tags, but I suspect that many programmers then would like to keep a flat structure so as to maintain the possibility of inserting scriptlets where needed - outside any tag which is based on a tag-file.
    So, why is it not allowed for tag-files to have body-content="JSP"?

    Thanks for the reply, evnafets.
    I'm aware that scriptet-code is generally being discouraged, although I don't understand why. I think that having a standard tag-library is a wonderful idea, but in the case of JSTL, I'm not that pleased. It relies heavily on EL, which I see as an unnecessary abstraction.
    Let me give you an example. The JSTL does database-connections and queries in this way:
    <sql:setDataSource var="datasource" url="jdbc:oracle:thin:@localhost:1521:TEMP" driver="oracle.jdbc.OracleDriver" user="scott" password="tiger" />
    <sql:query sql="SELECT * FROM EMP" dataSource="datasource" var="resultset" />This could also be accomplished without EL in a hierarchical structure:
    <sql:dataSource url="jdbc:oracle:thin:@localhost:1521:TEMP" driver="oracle.jdbc.OracleDriver" user="scott" password="tiger">
      <sql:query sql="SELECT * FROM EMP">
        BodyContent <% perhapsWithScriptlets; %>
      </sql:query>
    </sql:dataSource>...using TagSupport.findAncestorWithClass for the query to reference the datasource which it is enclosed in. (in Tomcat, the class would be called dataSource_tag. BTW, why is this not standardised in JSP?)
    I would then also like to be able to use scriptlet-code inside the tags as I could if the tags were written as tag-classes, extending BodyTagSupport, and being defined in a formal, cumbersome TLD file.
    Why the difference in functionality between SimpleTagSupport and BodyTagSupport - or rather; why is it then not possible to specify that a tag-file should extend BodyTagSupport rather than SimpleTagSupport?

  • JSP 2.0 tag file with conditional body?

    Is it possible to write a tag file that conditionally outputs its body?
    For example:
    <my:conditionalTag booleanAttr="false">
    Since booleanAttr is false, you will never see this output.
    </my:conditionalTag>
    Thanks,
    B

    I apologize for the typo..
    You can use the Java Standard Tag Library (JSTL), which has a <c:choose> tag with <c:when> or <c:if>. So as you can see with the example above, you are to use the <c:when> tag inside <c:choose> . Here is an example of using <c:if>(notice that you don't need the <c:choose> tag this time):
    <c:if test="${true}">
         do something
    </c:if>
    [/code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • JSP 2.0 tag files for rendering JSF components

    Over the weekend I read up on new JSP 2.0 features (dunno why I waited this long??) ... I really liked the tag file feature ...
    I was wondering if it were a good idea to use these tag files as renderers for JSF components - ok, this ties us to a JSP only solution but how many in here would be using a non-JSP solution anyway?
    I was thinking along the foll. lines:
    <myComponent id="myComponent1" attr1="value1" attr2=value2">
        <myComponentRenderer var="myComponent1" />
    </myComponent>
    myComponentRenderer can be implemented as a tag file in myComponentRenderer.tag ... The myComponent tag delegates the business logic processing to its associated UIComponent and then sets this component as a pageContext attribute with the id "myComponent1" ... myComponentRenderer in turn gets a reference to this UIComponent and renders it ...
    Again, if one wants a different way of rendering, make another tag file myComponentRenderer2.tag or change myComponentRenderer.tag itself ...
    Indeed, this may not work for components with complicated rendering logic but I believe that's only the 20% case ...
    Comments?
    P.S.:
    I've picked this up from http://forums.java.sun.com/thread.jsp?forum=427&thread=381052&tstart=0&trange=15
    This also compliments another topic: http://forums.java.sun.com/thread.jsp?forum=427&thread=413515&tstart=0&trange=15

    You are right in saying that decoding has nothing to
    do with rendering per se.I will go even further than Erik did, and dispute this statement.
    Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
    The "renderer" really does
    two completely different things. But both should
    nevertheless be separate from the component
    implementation itself. You could still have the
    renderer doing the decoding part, which arguably would
    rarely change, and somehow delegate the actual
    rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
    Craig

  • JSP 2.1 - tag files annotation

    Hi,
    In JSP 2.1 spec is specified that tag handlers that implement javax.servlet.jsp.tagext.SimpleTag could be annotated : JSP.7.1.11 Resource Injection. Tag files when compiled extend javax.servlet.jsp.tagext.SimpleTagSupport which class implements javax.servlet.jsp.tagext.SimpleTag.
    So my question is can my tag file be injected?
    <%@ tag import="javax.annotation.*" extends="javax.servlet.jsp.tagext.SimpleTagSupport" %>
    <%!      
         private String completeInjection = "injectionIsNotComplete!";
         @InjectionComplete
         private void echoInjection(){
              completeInjection = "injection Is Complete!";
    %>
    completeInjection:<%= completeInjection %>Thanks,
    Todor

    OK, so the integrated run-time supports JSP 2.0 and tag files. But what I'm after is support in the design-time components. Specifically, I want to produce a set of user interface components that I can place in the component palette and have rendered in the JSP visual editor.
    As far as I can tell (see previous post), jDeveloper's editor doesn't understand JSP 2.0 features. Therefore I suspect that the design-time as a whole doesn't and so I'll have to use regular Java tags for anything that needs to be able to be rendered at design time.
    Oh well. Maybe I can write a Java tag implementation that somehow invokes a tag file and just write a simple wrapper taglib specifically for use within jDeveloper at design time.
    L.

  • Adding an element with an attribute to destination schema that doesn't exist on source schema

    I have source schema which looks something like below:
    source schema
     name                    //attribute
     address1                //attribute
     address2                //attribute
     city                       //attribute
    I need to map it to a destination schema which looks like below:
    destination schema
    employee                  //record (repeating element)
      fieldname                //attribute
      type                       //attribute
    After mapping, the xml would look like below: 
    <employee fieldname= 'name' type='string'>
    <employee fieldname= 'address1' type ='string'>
    <employee fieldname= 'address2' type ='string'>
    <employee fieldname= 'city' type ='string'>
    (fieldname exists in source schema, but 'type'  doesn't. basing on the fieldname, I add it on the destination schema using ValueMapping functoid )And I am able to do it successfully, but my question is, I need to add a field called 'salary'
    of type 'double' to the destination schema similar to the other values
    <employee fieldname= 'salary' type ='double'>
    But salary doesn't exist in 'source' schema,  and it needs to be there in destination schema associated with the attribute 'type='dcouble''   How can I accomplish this? Appreciate any help. thanks!!

    Hi Anne,
    For your requirement, all you need is Table Looping functiod and Table Extractor functiod.
    In this example, I am not using the value mapping functiod (you can also use it, but I prefer to make this sample easier for you to understand) so using a “string” as constant.
    When you mean by you want
    <employee fieldname= 'name' type='string'>
    <employee fieldname= 'address1' type ='string'>
    <employee fieldname= 'address2' type ='string'> <employee fieldname= 'city' type ='string'>
    I assume you’re looking for something like this
    <employee fieldname= 'ValueOfName' type='string'>
    <employee fieldname= 'ValueOfAddress1' type ='string'>
    <employee fieldname= 'ValueOfAddress2' type ='string'>
    <employee fieldname= 'ValueOfCity' type ='string'>
    Or if you just need field names not the value of the fields, you can still do what you want with the way you do now but using Table Looping functiod and Table Extractor
    functiod.
    Let me explain this.
    Use Table Looping functiod with following parameters:
    5 = You need 5 records in output i.e. name, address1,address2,city and salary.
    2 = you need 2 columns. i.e. fieldname and type.
    Link from 'name' in source schema. Here I have just linked the 'name' from source schema, so this will have VALUE-of-Name element/attribute. Or if you can want just the
    field name, you can use the way you’re using to get the field name.
    Repeat the above step for all the rest of the fields. I have linked address1, address2 and city.
    7<sup>th</sup> parameter is “string” as constant, which I will be passing to “type” attribute in destination. Again you can use value mapping functiod as you
    do. If you use value mapping functiod, then rest of the parameter shall be value mapping functiod.
    Then I add last two paraters “salary” and “double” as constants, which I will be using to add the new record. Below image show the parameters for Table looping functiond:
    Now select the “Configure Table Looping grid” property and map as shown. Give a closer look to the way how this grid has been mapped. Last record in the grid shows the
    additional record which you want to add with “salary” and “double”
    Now add “Table Extractor functiod”, set its first parameter to “Table looping” and second parameter as “1”
    Now another “Table Extractor functiod”, set its first parameter to “Table looping” and second parameter as “2”. Below image show the Table Txtrator functiods parameters:
    Now link the Table Looping functiod to “employee” record in destination schema.
    Use the above you will get the output as you wanted. Following is the output, note: as mentioned in the fieldName attribute I have the value of the source fields/attributes
    since I have used the direct link from soruce in Table Looping functiod parameters, you can use the link which is producing the value for you now for fieldname:
    <employee fieldName="name_0" type="string"></employee>
    <employee fieldName="address1_1" type="string"></employee>
    <employee fieldName="address2_2" type="string"></employee>
    <employee fieldName="city_3" type="string"></employee>
    <employee fieldName="salary" type="double"></employee>
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Read XML file by elements with spaces

    Hi All,
    * I want to read an XML file using DOM
    <Employee>
    <Name> aaa </Name>
    <Age>27</Age>
    </Employee>
    * That is in the above example, i want read "Name" element value as " aaa" with spaces........
    * I tried with DOM and also SAX, but it removed the spaces of the elements.........
    * How to keep spaces of the elements Using DOM or SAX.............?
    * Thanks in advance
    WithRegards,
    JavaImran

    I suspect you need to read again your documentation on the DOM. You probably need Node.getTextContent(); but the detail of what you are doing matters so I could be wrong.

  • Spec oversight? Using dynamic-attributes in XML tag files

    I have a couple of tagfiles that generate form elements with specific conventions for the 'name' and 'value' attribute. Basically, a data binding framework.
    Dynamic attributes are useful because you can delegate all the usual html attributes to the generated HTML form element: SELECT, INPUT, id, class etc.
    The usual way to do this is to concatenate all the "pass-through" attributes to a string, and append this string to the element generated:
    <input type="hidden" name="foo" ${dynattrs}/>I'm wondering how to do this in a tagfile in XML format (mytag.tagx), since the XML format forbids syntax like in the example above.
    jsp:attribute won't help much, if it's nested inside a c:forEach: it won't apply to the right element.

    Ran into the same problem with 'optional attributes'. (see post "JSP 2.0 Tag files outputting elements with conditional attributes" http://forum.java.sun.com/thread.jspa?forumID=45&threadID=681033)
    Found a solution that is not very elegant but does work and saves you the trouble of reverting to Java Tags. Consider the following tag-file that outputs an html input-tag with conditional attributes:
    <?xml version="1.0" encoding="utf-8"?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
         xmlns:c="http://java.sun.com/jsp/jstl/core">
         <jsp:directive.attribute name="name" required="true" type="java.lang.String"/>
         <jsp:directive.attribute name="id" required="false" type="java.lang.String"/>
         <jsp:directive.attribute name="value" required="false" type="java.lang.String"/>
         <jsp:directive.attribute name="disabled" required="false" type="java.lang.Boolean"/>
         <jsp:directive.attribute name="hint" required="false" type="java.lang.String"/>
         <jsp:directive.attribute name="cssClass" required="false" type="java.lang.String"/>
         <jsp:text><![CDATA[<input type="text" name="]]><c:out value="${name}"/><![CDATA["]]></jsp:text>
         <c:if test="${!empty id}"><![CDATA[ id="]]><c:out value="${id}"/><![CDATA["]]></c:if>
         <c:if test="${!empty cssClass}"><![CDATA[ class="]]><c:out value="${disabled?(cssClass + '-disabled'):cssClass}"/><![CDATA["]]></c:if>
         <c:if test="${disabled}"><![CDATA[ disabled="disabled"]]></c:if>
         <c:choose>
              <c:when test="${!empty value}"><![CDATA[ value="]]><c:out value="${value}"/><![CDATA["]]></c:when>
              <c:when test="${!empty hint}"><![CDATA[ value="]]><c:out value="${hint}"/><![CDATA[" onfocus="if(this.value==']]><c:out value="${hint}"/><![CDATA[')this.value='';"]]></c:when>
         </c:choose>
         <jsp:text><![CDATA[/>]]></jsp:text>
    </jsp:root>In answer to your question: Yes, it looks like an oversight. Using the jsp:attribute tag in a c:forEach doesn't work because the attribute is then applied to the forEach tag. You would have to put the attribute-tag inside a jsp:body tag (inside the forEach). Then it would apply not to the forEach tag but to the tag enclosing the forEach. However, this doesn't work either, or at least it doesn't work in Tomcat 5.5. Could be a bug though, JSP 2.0 is still very buggy (for instance, using a tagfile inside another tagfile from the same taglib doesn't seem to work either...)
    Anyway, if you ever find a good solution please let me know by posting to this topic!
    TIA

  • BUG OJVM does not work with tag files

    Hello,
    A.
    1. Create tag file
    2. Create JSP that uses tag file <x:xy />
    3. Deploy to OC4J 10.1.3.2.
    4. Start OC4J.
    4. Access JSP - OK.
    B.
    1. Create tag file
    2. Create JSP that uses tag file <x:xy />
    3. Deploy to OC4J 10.1.3.2.
    4. Start OC4J with OJVM.
    4. Access JSP - OK.
    C.
    1. Create tag file
    2. Create JSP that uses tag file <x:xy> </x:xy>
    3. Deploy to OC4J 10.1.3.2.
    4. Start OC4J with OJVM.
    4. Error - the JSP cannot be displayed. No message.

    user519938,
    Am I missing something?
    B and C look identical to me.
    A and D also look identical to me.
    By the way, can you not count above 4?
    Good Luck,
    Avi.

  • How to skip validation for tag file, or jsp fragment?

    hi
    I have some jsp fragment and tag file in a workshop 10 project
    workshop blame me about the jsp fragment (no start/end tag)
    and unable to publish to server
    is there a way to skip validation on some files?
    I do found an check box call "validate JSP fragments" and I have un-ticked it. It does nothing.
    please help

    Yes, you can turn off validation either on project/folder/individual file.
    Project:
    Project > Properties - Validation AppXRay - un-check "Validate Workshop managed documents" (this is not recommended, you may loose entire AppXRay validation).Folder:
    Project > Properties - Validation AppXRay - Exclude Folders tab, if all the JSP fragments are present in a particular folder (under WebAppRoot), you can pick that folder to be excluded from AppXRay validationFile:
    Help > Help Contents - BEA Workshop User's Guide > Common IDE Tasks > "Using AppXRay" - Live Synchronization of artifacts with AppXRay - On this page scroll to the bottom you will find a table with list of comments that can be included in a JSP file to exclude file level validation.Ex:
    <%--<nitrox:set-property property="validation" value="true"/> --%>
    Controls all validation in the IDE. The default value of true enables validation.

  • WLS does not handle reusable jar with tag-files?

    I want to encapsulate some tag-files in a re-usable jar that can be included in multiple applications. According to all the documentation that I've found what I need to do is create a jar file containing:
    META-INF/taglib.tld
    META-INF/tags/myTag.tag
    where the taglib.tld contains (among other things):
    <uri>myTag</uri>
    <tag-file>
    <name>someName</name>
    <path>META-INF/tags/myTag.tag</path>
    </tag-file>
    Then I am supposed to take that jar file and put it in my web application under WEB-INF/lib,
    and in my index.jsp I can refer to <%@taglib prefix="myt" uri="myTag">
    However when I do this (on wls 12c) the application seems to deploy ok but when I try to access index.jsp I get:
    weblogic.servlet.jsp.CompilationException: Failed to compile JSP /index.jsp
    index.jsp:14:4: No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during parsing of the .tld file.
    <%@taglib prefix="tags" uri="myt" %>
    Related facts:
    1. When I deploy these projects in Glassfish it works . as I expected based on the documentation with no errors.
    2. If I copy the tag files and tld with no modification directly into the web application as:
    <my web app>/WEB-INF/taglib.tld
    and <my web app>/META-INF/tags/myTag.tag
    then it does work. However, that prevents me from packaging the tag-files as a re-usable jar.
    (Facts 1 & 2 seem to imply that the files are correct and that WebLogic is not handling the jar correctly?)
    3. I've seen suggestions that there needs to be a <taglib> entry in web.xml. I have tried this and...
    - the text I've seen on the web generates an error. It seems to need to be within a <jsp-config> entry in web.xml.
    - even with this I still get the same error.
    Does anyone have a suggestion for how to get Weblogic to handle tag-files inside a re-usable jar?
    Do you have an example jar you can point me to just to see that it works on my system?
    Is there some special configuration needed by Weblogic to tell it to handle this construct?
    And finally, the error message is saying that one of two things is wrong:
    Either:
    A) it cannot find the referenced taglib file, or
    B) the tld file failed to compile.
    Is there any way for me to find out which of these is happening? The error messages in WLS do not seem to give any more info, so I cannot easily distinguish between these possibilities.
    Thanks for your assistance.

    After 3 days of seeing this error, immediately after posting this request the problem disappeared. Sigh.
    So for now this problem is closed. If it comes back I'll re-post.

  • JSPs using Custom Tag with Boolean attribute cannot compile

    Hi,
    In Oracle9iAS(9.0.3), a jsp using a tag extension, which has a Boolean attribute, caused the following compile error, although the jsp is valid in other web containers.
    ERROR:
    /opt/oracle/j2ee/home/application-deployments/simple/simple/persistence/_pages/_test.java:56: Method toBoolean(java.lang.Boolean) not found in class _test.
    __jsp_taghandler_1.setExists( OracleJspRuntime.toBooleanObject( toBoolean( b)));
    JSP:
    <%@ page language="java" %>
    <%@ page errorPage="error.jsp" %>
    <%@ taglib prefix="jnpr" uri="/WEB-INF/testtag.tld" %>
    <%
    Boolean b = Boolean.valueOf("true");
    %>
    <jnpr:TestTag exists="<%= b%>"/>
    The boolean value is <%= b %>
    Tag Handler:
    package defaultpak;
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.jsp.*;
    public class TestTag extends TagSupport{
    private Boolean exists = null;
    private java.lang.Boolean getExists() {
    return exists;
    public void setExists(java.lang.Boolean newExists) {
    exists = newExists;
    public int doStartTag() throws JspException {
    return super.doStartTag();
    Is this a known problem? Is there a way to get around this?
    Thanks in advance.
    Fred

    This is a known issue with 903, fixed in coming 904.
    In 903 the workaround is to use primitive type "boolean" instead of Object type "java.lang.Boolean" in user's getter and setter code for the taglib.
    -Prasad

Maybe you are looking for