Custom Tag using object as an attribute.

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

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

Similar Messages

  • Custom Tag not evaluating expression in attribute

    I have a custom tag that needs to take dynamic values in the attributes, but I can't seem to get the values "interpreted" correctly. I have the <rtexprvalue> tag set to "true" in my .tld file, which I thought was the only thing that was needed in order to accomplish what I am trying to do. However, that does not seem to be the case.
    I am using WebLogic (8.1.4) and their <netui> tags, along with JSTL tags (1.0).
    An example of what my code looks like is the following:
    <test:myTag id="1" idx="<netui:content value='{container.index}' />">
        <netui:select ... />
    </test:myTag>and
    <c:set var="myIdx" value="<netui:content value='{container.index}' />" />
    <test:myTag id="1" idx="<c:out value='${myIdx}' />">
        <netui:select ... />
    </test:myTag>Neither of the above approaches has worked. In my code for my Tag.java file, I get the literal string values of <netui:content value='{container.index}' /> and <c:out value='${myIdx}' />, respectively, in my idx property.
    Can someone give me any hints as to what I may be doing wrong?
    Thanks.

    Shouldnt that be
    <netui:content value='${container.index}' />Actually, weblogic does not use the '$' prefix before
    their expressions. Fine. Which in turn means weblogic has some custom expression evaluator.
    Note weblogic 8.1
    as a container doesnt implicitly supportexpressions
    and you have to build in that feature into yourtag
    library.Are you referring to the 'isELIgnored' attribute when
    you mentioned the above statement? If not, can you
    explain what you meant by "build that feature into
    your tag library"?
    It's like this - expression language is supported by default in all containers that implement the j2ee 1.4 spec (servlet 2.4/jsp 2.0). Additionally you should also declare your web application to adhere to the 2.4 standards (through the schema definition in web.xml). In applications that refer to the 2.3 dtd but are run on a 2.4 compliant container you can set the 'isELIgnored' attribute to false and use EL. This works because your container anyways supports it.
    If your container doesnt provide support for EL (outside the jstl tags) as is the case with weblogic 8.1, then you can still use expressions by using something like the [url http://jakarta.apache.org/commons/el/]apache common evaluator  package. The difference being that you will have to call the evaluator classes to evaluate the attribute.
    Are there any alternatives that I could use to
    accomplish what I am trying to do?Did the above answer your question?
    ram.

  • Custom Tag won't display the attributes

    Quick summary: I can't refer to the attributes passed in to by custom tag.
    I have a .jsf page that is passing two strings. One is from the backingBean and the other is hardcoded.
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <%@taglib prefix="p" tagdir="/WEB-INF/tags"%>
    <c:subview id="recommendedView">
         <h:dataTable id="recommendedlist" value="#{recommendedBean.recommendedList}" var="item" >
                <h:column >
                   <c:facet name="header"><h:outputText value="Recommended"></h:outputText></c:facet>
                   --<h:outputText value="#{item.title}"/>--
                   <p:custom varid="${item.title}"  hardid="My Title"  />
                </h:column>
          </h:dataTable>
    </c:subview>The --<h:outputText value="#{item.title}"/>-- shows that I do have a value when call this custom tag with item.title passed as varid.
    Now the tag looks like this: custom.tag located in /WEB-INF/tags/
    <%@tag description="put the tag description here" pageEncoding="UTF-8"%>
    <%@attribute name="varid" required="true" %>
    <%@attribute name="hardid" required="true" %>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    Test1: var<h:outputText id="test1" value="#{varid}" ></h:outputText>*<br>
    Test2: hard<h:outputText id="test2" value="#{hardid}" ></h:outputText>*<br>
    Test3: noOutputText-Var= ${varid}*<br>
    Test4: noOutputText-Hard= ${hardid}*<br>I was told I needed to have an implicit.tld file and I read it also here (http://blogs.sun.com/roller/page/jluehe?entry=implicit_tag_libraries_require_and)
    So here's my implicit.tld (also located under /WEB-INF/tags/
    <?xml version="1.0" encoding="UTF-8"?>
    <taglib version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd">
      <tlib-version>2.1</tlib-version>
      <jspversion>2.1</jspversion>
      <short-name>Custom Tags</short-name>
    </taglib>So the problem is when I refer varid - I get nothing (nothing writes out in either case using outputText or just ${varid}).
    And when I refer to hardid, I get nothing for the outputText test but I do get something for the ${hardid} test.
    I don't see this a reference to this problem alot on the web so I figure I must be missing something obvious but I just don't know what.
    Does anyone have any ideas?
    Thanks.
    C

    Are you using Windows Vista? If so and you have Aero turned on that sometimes causes strange things like that. It used to happen to me in Fireworks. The way I got around it was having it launch Fireworks in compatibility mode that would revert the display from Aero to standard.

  • Setting up custom tags using Cfmodule?

    I have just set a site up on Godaddy, on a shared CF server, so I don't have access to the administrator to set up a custom tag
    I believe it's possibly to set up a tag by uploading into my web root and then referring to it using CFMODULE
    Can anybody offer any help on this as I can't get it working.
    the issue is I want to set up DLL custom tags, such as CFX_ZIP (CFX_ZIP), and CFX_GIFSIZE (gifsize.dll)
    Thanks
    Mark

    I guess I could try some createobject code to see if it works on godaddy
    Would you be able to post some example code?
    Sure. Here is a simple test. If by some miracle that actually runs without error, you can find a .NET example in the documentation
    <cfset str = createObject("java", "java.lang.String").init("Test this")>
    <cfoutput>#str#</cfoutput>
    Also, find out what version of CF you are using. If it is CF8+ you are in business.
    <cfoutput>
    version #server.coldFUsion.ProductVersion#
    </cfoutput>

  • Custom tag using viewobject

    Hi all
    Im developing a JSP 1.2 tag lib for our production enviroment to save us alot of repetitive code, therefore i decided to make a table component that can do sorting on header and would like to write the sorting code directly in the doStartTag on the library but my issues is the following:
    I send ${bindings.testData1.rangeSet} as an attribute on the table tag, this translates into a "oracle.jbo.uicli.binding.JUCtrlRangeBinding$1" (note the $1 at the end) in the actual code, my issue is that i need it to be "oracle.jbo.uicli.binding.JUCtrlRangeBinding" in order to typecast it. But unfortunatly i cant typecast it since the $1 is most likely the local implements and not the actual class...
    I might be approaching the issues incorrectly and should try and get something out of the pagecontext as well, but since i allready have the variable it seems to be the easiest to just get the actual collection and sort it instead of having to go through the applicationmodule etc.
    All ideas are very welcome, hope the question makes sense :)
    Edited by: Jesper Lind on 16-Feb-2009 05:11

    Hi Frank
    Well the thing is that the rangeset is a colletion so can get the iterator from that, but the thing is i would like to get the view object it belongs to so i can do sorting, but by the looks of it i have to do some java reflection to get the enclosingclass out or something similar.
    in the jsp it looks like the following:
    <sometag:table items="${bindings.testData1.rangeSet}"...
    Then in the java class "items" is read as a collection and then the iterator from the collection is used to create a loop.
    What i would like to do is something like e.g pseudo code.
    JUCtrlRangeBinding b = (JUCtrlRangeBinding)collection.getEnclosingClass();
    b.getViewObject().setSortBy("some column");

  • Custom Tags Using Facelets

    I am trying to simplify a lot of pages by using Facelets and custom taglibs that are just .xhtml pages with other Standard JSF components inside them. My problem is not really related to that, but it gives a bit of background info: What I am trying to do is simplify the naming of binding and value attributes by trying to concatenate Strings to form a reference to a managed bean/property.
    I am trying to do something like this:
    <c:set var="componentVal" value="'#{formBinding}.#{formName}.#{componentName}'" />
    <c:set var="componentBind" value="'#{beanBinding}.#{formName}.#{componentName}'" />
    <h:inputText id="#{id}" value="#{componentVal}" binding="#{componentBind}" size="#{size}" />This comes after iterations of trying to just concatenate the bound variables (formBinding, formName, and componentName are defined earlier). Is this possible in JSF or am I barking up the wrong tree? I am trying to use this solution because we have one session-bound managed bean with different components for different tabs on the screen, and are accessed via a map, which makes the names quite long, and they only give us 17" monitors here, so, aside from making it cleaner, I will actually get to see what I am doing without scrolling all over the place.
    Thanks for any and all help/advice.

    I guess I could try some createobject code to see if it works on godaddy
    Would you be able to post some example code?
    Sure. Here is a simple test. If by some miracle that actually runs without error, you can find a .NET example in the documentation
    <cfset str = createObject("java", "java.lang.String").init("Test this")>
    <cfoutput>#str#</cfoutput>
    Also, find out what version of CF you are using. If it is CF8+ you are in business.
    <cfoutput>
    version #server.coldFUsion.ProductVersion#
    </cfoutput>

  • Problem with custom tag using TagExtraInfo

              Hi,
              I have a tag that create a Java variable using TEI. The scope of this
              variable is driving me crazy. The problem is hard to describe, so the
              email is a bit long - stay with me...
              <pre:setvar id="foo" value="test" /> create a Java variable
              named "foo", which has String value "test". I can use "foo" like this in
              the page later: <%= foo %>.
              Now, if I call setvar twice with same id:
              <pre:setvar id="foo" value="test" />
              <pre:setvar id="foo" value="another-test" />
              This is still ok. By checking the compiled Java file, the first call
              declare the var, the second call just use it without creating it again:
                   //first call
                   String foo=null;
                   foo="test";
                   //second call
                   foo="another test";
              Now the problem comes when the frist call is in "if" statement (code is not
              useful, only for demostration):
              <% if (1>0) { %>
                   <pre:setvar id="foo" value="test" />
              <% } %>
              <pre:setvar id="foo" value="another-test" />
              The compiled code looks like:
                   if (1>0) {
                        //first call
                        String foo=null;
                        foo="test";
                   //second call
                   foo="another test";
              Variable foo is out of scope at the second call! (BTW, I can workaround this by
              adding another <pre:setvar id="foo" value="" /> before the "if".)
              Is it a fault in JSP specification? Or a problem when WebLogic implements TEI?
              Any idea?
              Thanks,
              -- Jin
              

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

  • Problem with a custom tag using Jasper Report

    Hi everybody, I'm deprived of hope,
    I wrote this code for a custom taglib to convert a .jasper file into a .pdf file:
    package com.tag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import net.sf.jasperreports.engine.*;
    import net.sf.jasperreports.engine.export.*;
    import net.sf.jasperreports.engine.util.*;
    import net.sf.jasperreports.view.*;
    import java.sql.*;
    import org.apache.commons.logging.*;
    import java.io.*;
    import java.util.*;
    public class GeneratePDF extends TagSupport
    private String sourceFileName = "C:\\default.jasper";
    private String destinationFileName = "C:\\default.pdf";
    public void setSourceFileName(String sourceFileName)
    this.sourceFileName = sourceFileName;
    public void setDestinationFileName(String destinationFileName)
    this.destinationFileName = destinationFileName;
    public int doStartTag()
    return SKIP_BODY;
    public int doEndTag()
    try
    //Passaggio parametri da passare al jasper.
    Map parameters = new HashMap();
    parameters.put("param1", new Integer(1));
    //Preparazione del file da stampare (in questa fase si esegue la query e si inseriscono
    //i valori estratti dalla query)
    JasperPrint jasperPrint=JasperFillManager.fillReport(sourceFileName, parameters, getConnection());
    //Creazione del PDF
    JasperExportManager.exportReportToPdfFile(jasperPrint, destinationFileName);
    System.exit(0);
    catch(Exception e)
    { e.printStackTrace();}
    return EVAL_PAGE;
    /**Metodo per creare la connessione al DB*/
    private static Connection getConnection() throws ClassNotFoundException, SQLException {
    //Change these settings according to your local configuration
    String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String connectString = "jdbc:odbc:gecoware";
    String user = "admin";
    String password = "password";
    Class.forName(driver);
    Connection conn = DriverManager.getConnection(connectString, user, password);
    return conn;
    No errors while compile but in execution I have this message:
    javax.servlet.ServletException: net/sf/jasperreports/engine/JasperFillManager
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:872)
    org.apache.jasper.runtime.PageContextImpl.access$1100(PageContextImpl.java:114)
    org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:792)
    java.security.AccessController.doPrivileged(Native Method)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:790)
    org.apache.jsp.reportPDF_jsp._jspService(reportPDF_jsp.java:80)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:141)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
    root cause
    java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JasperFillManager
    com.tag.GeneratePDF.doEndTag(GeneratePDF.java:49)
    org.apache.jsp.reportPDF_jsp._jspx_meth_JR_GeneratePDF_0(reportPDF_jsp.java:97)
    org.apache.jsp.reportPDF_jsp._jspService(reportPDF_jsp.java:68)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:141)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
    java.security.AccessController.doPrivileged(Native Method)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
    Please HELP ME !!!!!!!!!
    Thank you in advance
    AleX

    Do you have the Jasper classes in /WEB-INF/lib?

  • Using gateway'd URLs in JSP custom tag attributes

    Hello,
    I am running Plumtree G6 using a gateway prefix to gateway Javascript from a remote server. I have recently discovered, thanks to people's help on the forum here, that in certain cases, you need to wrap a URL in a pt:url tag in order for Plumtree to recognize it as a URL that has to be gateway'd (i.e. a URL inside of a Javascript function).
    However, I have a custom tag that contains a contextPath attribute. This custom tag then includes other XML files that get included in the final page that is displayed. I am passing this value as my contextPath:
    <mytag:body sessionName="mysession" campusName="SampleCampus" contextPath="<pt:url pt:href='http://localhost:7021/application/scripts' xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>"/>
    However, in the resulting content that is created from this custom tag, the contextPath value is still set to <pt:url pt:href=......./>, and not the actual gateway'd URL. I would have thought that Plumtree would have recognized and gateway'd this URL before it got substituted in the custom tag.
    Does anyone have any thoughts on how to get around a problem like this? One thought I had was to get ahold of the gateway URL value and pass that value directly in my contextPath attribute. Is it possible to get that gateway value, or is there a better solution here?
    Thanks again for any help you can provide.

    Chris,
    I added your code, changed the portlet's web service to send a login token for this portlet, and was then getting some ClassNotFoundExceptions related to Axis classes. So, I went and added all of the jar files from the devkit's lib directory (i.e. plumtree\ptedk\5.3\devkit\WEB-INF\lib), recompiled, and those errors went away. But, now I see the following error:
    java.lang.NoSuchFieldError: RPC
         at com.plumtree.remote.prc.soap.QueryInterfaceAPISoapBindingStub.(QueryInterfaceAPISoapBindingStub.java:27)
         at com.plumtree.remote.prc.soap.QueryInterfaceAPIServiceLocator.getQueryInterfaceAPI(QueryInterfaceAPIServiceLocator.java:43)
         at com.plumtree.remote.prc.soap.QueryInterfaceProcedures.(QueryInterfaceProcedures.java:37)
         at com.plumtree.remote.prc.xp.XPRemoteSession.(XPRemoteSession.java:202)
         at com.plumtree.remote.prc.xp.XPRemoteSessionFactory.GetTokenContext(XPRemoteSessionFactory.java:80)
         at com.plumtree.remote.portlet.xp.XPPortletContext.getRemotePortalSession(XPPortletContext.java:261)
         at com.plumtree.remote.portlet.PortletContextWrapper.getRemotePortalSession(PortletContextWrapper.java:45)
         at jsp_servlet._collabrasuite.__riarooms._jspService(__riarooms.java:325)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:417)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    I am using version 5.3 of the EDK, and running Plumtree Foundation G6. Have you ever seen an error like this before?
    Thanks again for all of your help.

  • How can I use evaluate to get the instance variable in customized tag

    1.
    At first , I create a class called bean,and declared several params in it and do not define any getter function for the param.
    class bean{
    String param = "test";
    SomeClass scObj = new SomeClass();
    2.
    The second ,I use
    request.setAttribute("beanObj",new bean());
    3.
    And then I wanna use the customized tag to show a text box , then initialize it's value.
    <salt:text name="param" value="beanObj.param">
    <salt:text name="obj" value="beanObj.scObj.func()">
    4.
    I tried the evaluator provided by JexlContext ,Struts, JSTL and it seems that if I do not define the getter for the variable ,I can not get the bean's instance variable's value.
    Expression e = ExpressionFactory.createExpression( value );
    JexlContext jc = JexlHelper.createContext();
    jc.getVars().put(strInitBeanName, request.getAttribute("beanObj"));
    Object obj = e.evaluate(jc);
    the result of the obj is null....
    Can anybody recommand some other evaluator can get the value of a instance variable from an object?

    do you have any other suggestion ? Nops, somebody else may have though. AFAIK, all lookups of the type
    beanName.propertyNameuse reflection on the getXXX() methods to access the property.
    Having said that, I guess you could write one though in a custom tag, using the same - reflection (you will ahve to rely on the java.lang.reflect.Field class quite heavily) - but that would be reinventing the wheel for most other functionality that you would have to include (like looking up the bean in scope etc)
    cheers,
    ram.

  • Using JSTL tag in a custom tag

    Hello,
    I have created a custom tag, and I want to call the c:import tag inside the doTag method of my custom tag. Is this possible ?
    Thanks in advance for any answer!

    Hello,
    I have created a custom tag, and I want to call the
    c:import tag inside the doTag method of my custom
    tag. Is this possible ?
    Not in tag classes. Possible if you implement custom tags using [url http://www.onjava.com/pub/a/onjava/2004/05/12/jsp2part4.html]tag files
    ram.

  • Problem Calling Query in Custom Tag

    I am using this code to call a custom tag called
    broadcast.cfm
    <cf_broadcast query="fe" orgID = "4">
    The query fe is an included file on my site and is available
    to the page I'm calling the custom tag from.
    In the custom tag I am referencing the query like:
    <cfloop query="#attributes.query#">
    but I keep getting this error:
    "The value of the attribute query, which is currently "fe",
    is invalid. "
    I must be missing something really simple here but can't
    figure out what.

    quote:
    Originally posted by:
    -==cfSearching==-
    rdk8487 wrote:
    > In the custom tag I am referencing the query like:
    > <cfloop query="#attributes.query#">
    > but I keep getting this error:
    > "The value of the attribute query, which is currently
    "fe", is invalid. "
    It is a scoping problem. The query is defined in the calling
    page. To access it by name, within the custom tag, use the "caller"
    scope.
    <cfloop query="caller.#attributes.nameOfTheQuery#">
    If the query object is passed to the custom tag via an
    attribute you shouldn't need the caller scope. See attached sample.

  • Creating deferred-value custom tags

    I'm creating my own custom tag using the /WEB-INF/tags/ implementation
    (see page: http://today.java.net/pub/a/today/2003/11/14/tagfiles.html)
    I need to pass a deferred value attribute but I get an error that states "According to the TLD, the attribute is not a deferred-value but the specified value contains a #-expression.
    Any ideas what I'm missing?
    Thanks,
    Corinne
    Message was edited by:
    CEckel

    No, there is no workaround I am aware of for this.
    I would recommend you just copy the struts tld, map it to a different URI and then add your custom extension stuff to that.

  • Dynamic include inside custom tag body

    I am trying to perform the dynamic include of another JSP from within the body of a custom tag using JSP1.1. It cannot be done using <jsp:include> since flush=true is required and thus an exception is thrown when called from inside the body of a custom tag - it can be done in JSP1.2 since flush does not have to be set to true but upgrading is not possible at this time.
    Does anyone know of any custom tag or the code needed to perform this function with JSP1.1?
    I am using Tomcat 3.2.3.
    Using a RequestDispatcher and calling include() does not have the desired effect since the output is witten directly to the response and does not go into the correct position in the calling JSP.
    I think the solution involves making a call to the included JSP (is it possible to use a RequestDispatcher that doesn't write directly to the page output stream?) and then append the response to the BodyContent object which is buffering the body content of the custom tag until the doAfterBody() method is called. Is it possible to create a dummy ServletResponse object to pass to the RequestDispatcher and then obtain the HTML response from the internal buffer?

    I don't know if there is a solution to the problem you are having with JSP 1.1. If you look in the spec, it actually warns you that dynamic includes can not be done inside a body tag. The spec actually states that the included code shout write directly to the response and not to the BodyContent.
    I was excited to find out they had fixed this in JSP 1.2, but they seem to have foiled me again. If my tag calls PageContext.include(), the spec says that include must call the flush method, which causes BodyContent to throw an exception since flush is not a valid call.

  • Problem with custom tag

    I have written a custom tag that I am having problems with. It works on some machines, but not on others. I have a page that uses many 'standard' tags. I have correctly set the URI etc, because all of my other tags work. However, on some machines, my custom tag gives me an error:
    attribute does not support request time values
    I'm assuming that I have the correct versions of standard.jar etc because all of the regular jstl 1.1 tags work. It is just my custom tag that throws an error.
    here is the .tld for my tag:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
         <tlib-version>1.1.2</tlib-version>
         <jsp-version>1.2</jsp-version>
         <short-name>My custom tag</short-name>
         <uri>http://my.custom/tags</uri>
         <tag>
              <name>breadcrumb</name>
              <tag-class>tag.BreadcrumbTag</tag-class>
              <body-content>JSP</body-content>
              <attribute>
                   <name>breadcrumbs</name>
                   <required>true</required>
                   <rtexprvalue>false</rtexprvalue>
                   <description>Pass in the list of Breadcrumbs containing the actual information
    about what tags need to be rendered on the page.</description>
              </attribute>
         </tag>
    </taglib>
    Any thoughts/help greatly appreciated...

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

Maybe you are looking for

  • Running Leopard on one partition and Tiger on another partition?

    I have recently purchased a family pack of Leopard, and I am reading up on a lot of the posts, here, before I venture the installation on two machines. I intend to install Leopard one machine at a time and give a few weeks between installations. One

  • Verizon connectivity almost never works on my new iPad

    I'm wondering if others are seeing this. Here's what's happening: - this past Tuesday I signed up from my iPad for the $30/mo Verizon plan. I tested web browsing and it worked - subsequent attempts to use it failed. I see "Verizon LTE" and full bars

  • VC - Characterstics and Values associated with a Production Order

    Is there a way to get the variant configuration details (Characterstics and it's Values) related to a particular production order  which was created as a result of the selection of that component in the Super BOM. For. Ex   Let's  Say   Material A   

  • Mismatch of version of external and kernel dp lib

    Hello All i'm trying to uppgrade a was abap kernel 7.00 from version 133 to 16 on  db2 udb database. I use the files: SAP Kernel 700 64-Bit, Unicode, AIX64bit - FOR ECC60 Landscape: SAPEXEDB_146-20000977.SAR SAPEXE_146-20000978.SAR lib_dbsl_156-20000

  • Barcode BC_CD39 not found for Adobe forms

    Hi All, There is a BARCODE format BC_CD39 that we use in SAP Script for printing barcodes. In Adobe forms, BARCODES are classified on their technical bar code names. following link is the reference to the same. Link: http://help.sap.com/saphelp_nw04/