Custom tag - setProperties() not called

Hi all,
I've created my first custom tag with it's own component class, Tag Class, Renderer and TLD. However, when the JSP first loads, the encode() method fails in trying to get the attribute values from the attribute Map - the Map is empty. Upon further debugging I can see that the Tag class is called and the setter methods are called for each attribute but the setProperties() method is never called before release(), so the attributes are never stored in the UIComponent's attribute Map.
Anybody know what I'm doing wrong?
Some code:
Tag Class...
public class ListShuttleTag extends UIComponentTag
public void setProperites(UIComponent component)
  super.setProperties(component);
  ComponentTagHelper.setString(component, "sourceValue", sourceValue);
  ComponentTagHelper.setString(component, "targetValue", targetValue);
  ComponentTagHelper.setInteger(component, "size", size);
  ComponentTagHelper.setInteger(component, "targetListWidth", targetListWidth);
  ComponentTagHelper.setInteger(component, "sourceListWidth", sourceListWidth);
  ComponentTagHelper.setString(component, "sourceCaption", sourceCaption);
  ComponentTagHelper.setString(component, "targetCaption", targetCaption);
...TLD...
  <taglib>
    <tlib-version>1.1</tlib-version>
    <jsp-version>2.1</jsp-version>
    <tag>
      <name>listShuttle</name>
      <tag-class>com.katun.jsf.tag.ListShuttleTag</tag-class>
      <description>A listShuttle allows the moving of items from one listBox to another</description>
      <!-- General component attributes -->
      <attribute>
        <name>binding</name>
        <description>
             A binding that points to a bean property
        </description>     
      </attribute>
      <attribute>
        <name>id</name>
        <description>The client id of this component</description>     
      </attribute>
      <attribute>
        <name>rendered</name>
        <description>Is this component rendered?</description>     
      </attribute>
      <attribute>
        <name>disabled</name>
        <description>Is this component disabled?</description>     
      </attribute>
      <attribute>
        <name>required</name>
        <description>Is this component required?</description>     
      </attribute>
      <!-- listShuttle specific attributes -->
      <attribute>
        <name>sourceValue</name>
        <required>true</required>
        <description>A binding for the items in the source list</description>
      </attribute>
      <attribute>
        <name>targetValue</name>
        <description>A binding for the items in the target list</description>
      </attribute>
      <attribute>
        <name>size</name>
        <description>Defines the number of items visible in each list</description>
      </attribute>
      <attribute>
        <name>sourceListWidth</name>
        <description>Width of the source list</description>
      </attribute>
      <attribute>
        <name>targetListWidth</name>
        <description>Width of the target list</description>
      </attribute>
      <attribute>
        <name>sourceCaption</name>
        <description>Label displayed above the source list</description>
      </attribute>
      <attribute>
        <name>targetCaption</name>
        <description>Label displayed above the target list</description>
      </attribute>
    </tag>
...

Gotcha........
First, this is what the jsp spec has to say in sec 1.14.1
When using scriptlet expressions, the expression must
appear by itself (multiple expressions, and mixing of expressions and string
constants are not permitted). Multiple operations must be performed within the
expression.Simple, isnt it ? All you have to is evaluate the expression as a whole.
<form:toolbaritem id="icon_cancelar" action="<%="javascript:listingAction('" + request.getContextPath() + "/logout.do;')"%>" icon<%= request.getContextPath() + " /images/toolbar/Cancelar_32.gif " %>"/>cheers,
ram.

Similar Messages

  • Custom Tag Attribute not correctly rendered

    Hello,
    I made a custom tag and I want the engine to parse dynamic scripts and evaluate them.
    I call the tag like this :
        <form:toolbaritem id="icon_cancelar" action="javascript:listingAction('<%= request.getContextPath() %>/logout.do');" icon="<%= request.getContextPath() %>/images/toolbar/Cancelar_32.gif"/>The icon and action attributes are declared in the tld like so :
              <attribute>
                   <name>action</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>icon</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>However, the tag is not working with the evaluated expression, receiving "<%= request.getContextPath() %>" instead.
    Any help would be very welcome :) thank you
    Eamerial

    Gotcha........
    First, this is what the jsp spec has to say in sec 1.14.1
    When using scriptlet expressions, the expression must
    appear by itself (multiple expressions, and mixing of expressions and string
    constants are not permitted). Multiple operations must be performed within the
    expression.Simple, isnt it ? All you have to is evaluate the expression as a whole.
    <form:toolbaritem id="icon_cancelar" action="<%="javascript:listingAction('" + request.getContextPath() + "/logout.do;')"%>" icon<%= request.getContextPath() + " /images/toolbar/Cancelar_32.gif " %>"/>cheers,
    ram.

  • Custom Tag output not being rendered in JSF

    Hello,
    I have the following for loop in a custom tag that I developed;
    out.println("<ul>");
    for (int i = 0; i < noOfDays; i++)
    //out.println("<li><h:commandLink value=\"" +DateHelper.addDays(dtToday, i)+ "\" action=\"#{BookingBean.showAvailability}\"/></li>");
    out.println("<li><a href=\"" +DateHelper.addDays(dtToday, i)+ "\">" DateHelper.addDays(dtToday, i) "</a></li>");
    out.println("</ul>");
    The issue I have is that the second line prints out fine whereas the first one (when uncommented) prints out the bullet points associated with a list but does not render the h:commandLink.
    Any thoughts would be great.
    Cheers,
    Rich

    Hi,
    You can not embade a JSF tag in your code as you did, try adding component as children to your custum tag
    see this code as exemple : [HTMLDataTable.java|http://www.docjar.com/html/api/org/apache/myfaces/component/html/ext/HtmlDataTable.java.html]

  • Custom logon module not called by the portal

    Hi, all.
    I need some help urgently on this new portal requirement. There are some sensitive ESS/MSS iviews that we need to give the users an additional logon challenge. The normal ESS/MSS iviews will be using SSO. This one will still use SSO, but have to pass the userid/password challenge.
    We have decided to use the authentication scheme. Also, the "form" logon stack has been modified with only one logon module, which is our customized one. To create the java project, jar and library, we are following the link: http://help.sap.com/saphelp_nw04s/helpdata/en/46/3ce9402f3f8031e10000000a1550b0/frameset.htm
    Here's the extract of our authscheme.xml:
            <authscheme name="certlogon">
                <authentication-template>
                    client_cert
                </authentication-template>
                <priority>21</priority>
                <frontendtype>2</frontendtype>
                <frontendtarget>com.sap.portal.runtime.logon.certlogon</frontendtarget>
            </authscheme>
            <authscheme name="coo_secure">
                <authentication-template>
                    form
                </authentication-template>
                <priority>40</priority>
                <frontendtype>2</frontendtype>
                <frontendtarget>com.sap.portal.runtime.logon.basicauthentication</frontendtarget>
            </authscheme>
            <authscheme name="basicauthentication">
                <authentication-template>
                    ticket
                </authentication-template>
                <priority>20</priority>
                <frontendtype>2</frontendtype>
                <frontendtarget>com.sap.portal.runtime.logon.basicauthentication</frontendtarget>
            </authscheme>
    The authscheme is called coo_secure. When a user clicks on the iviews with the coo_secure authscheme, a userid/pwd prompt pops up. But it does not accept whatever I type in. From the defaulttrace, I do not see any hint that our customized logon module was ever called.
    Is there anyway to turn on portal tracing to see what is going on?
    Thanks,
    Jonathan.

    Hi Jonathan,
    Did you solved the problem with the custom logon module?
    We have a very similar scenario. I followed below help site to implement a custom logon module for particular iviews.
    http://help.sap.com/saphelp_nw70/helpdata/EN/54/f91fba71ae48309e4267b4a36fa47b/frameset.htm
    and also the documentation:
    SAP Netweaver Developers Guide - Integrating Security Functions
    But I am not able to get my own custom login module with the custom authscheme running.
    If I access my specific IViews that requires additional custom authentication I get the portal login page again. After giving login data I get the error message:
    Java iView Runtime
    An exception occured while processing your request.
    If this situation persists, please contact your system administrator.
    If you solved your problem, can you please share the solution with me?
    Thanks,
    Regards,
    Yasar

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

  • Customer Exit not called upon in the Query...

    Dear Guys,
    I am working on the "Slow Moving Item(MC46)" report in BW.We need "No.of Days Not consumed" in the Input selection screen in the BW Query.We tried creating a Formula variable upon "Calday" with Data type "Numeric" and then a Customer Exit is called to the Subtract the "No. of days not consumed" from "Today's date(System Date)" and gives the result as "Earlier date" .
    (Eg: Today's Date : 04-04-08
           No. of Days Consumed : 30
           ZSlow_Mov_Date          : 03-03-08).
    But for some reason the Customer exit is not called upon when we execute the Query (RSRT-->Execute + Debug option)..Can someone take time to throw some light on this,plz?
    Manythanks
    Arun

    Hello Arun,  
    In the User Exit Code, please check at what I_STEP value the variable exit is called.
    See this link for more info about I_STEP
    [Dependencies for Variables of Type Customer Exit |http://help.sap.com/saphelp_nw04/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/frameset.htm]
    Thanks
    [Chandran|http://chandranonline.blogspot.com/]

  • Recursive custom tag: different behaviour in WinXP and Linux

    Hi all,
    I've a strange behaviour on a web application for which I developed a custom tag to render a tree structure.
    This tag take in input an object representing the tree with all its nodes, and render every node, calling hitself recursively for every child of every node.
    This tag is used inside a jsp.
    I deployed my webapp on JBoss in a WinXP Pro environment, and everything is ok. Then I deployed the same webapp on JBoss in a Linux Env, and the call to the custom tag... doesn't write anything (with the same input).
    Used jdk are 1.6.0_10 on WinXP and 1.6.0_7 on Linux (an OpenSuse professional distribution). JBoss is 4.2 (I did tests with JBoss 4.2.2 and 4.2.3).
    Here is a sample code of my tag (file outree.tag):
    <%@ tag language="java" pageEncoding="UTF-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
    *<%@ taglib prefix="ousel" tagdir="/WEB-INF/tags/ouselector" %>*
    <%@ attribute name="subtree"
              required="true"
              type="my.webapp.TreeObject" %>
    <%@ attribute name="subroot_index" required="true" type="java.lang.Integer"%>
    <log:debug category="my.webapp.ousearch.taglib" message="Tag library called, starting operations..." />
    <c:if test="${not empty subtree.children}">
         <c:set var="next_subtree_index" value="${subroot_index + 1}"/>
         <ul class="subtree" id="subtree-${subroot_index}">
         <log:debug category="${logcategory}" message="We have children, calling recursively tag library on them (next subtree index: ${next_subtree_index})..." />
         <c:forEach var="currentOUChild" items="${subtree.children}">
              *<ousel:outree subtree="${currentOUChild}" subroot_index="${next_subtree_index}"/>*
              <c:set var="next_subtree_index" value="${next_subtree_index + 1}"/>
         </c:forEach>
         </ul>
    </c:if>
    </li>The TreeObject contains a list of children that can contain other children and so on. On every child, I call recursively my custom tag to render with a set of nested <ul> elements the entire tree structure.
    Here the call from the jsp:
    <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
    *<%@ taglib prefix="ousel" tagdir="/WEB-INF/tags/ouselector" %>*
    <log:debug category="${logcategory}" message="Building subtree ${ouSubtree} HTML structure..." />
    *<ousel:outree subtree="${ouSubtree}" subroot_index="1"/>*
    <log:debug category="${logcategory}" message="Subtree ${ouSubtree} HTML structure built" />
    ...Jakarta log taglibs is used to log the value of the parameter passed to the custom tag. In the Linux env I see that the passed object is not empty (it couldn't be null because the tag enforce it as a mandatory value).
    Any idea?

    I have found a workaround.
    Simply substitute the recursive invocation, with an import of a jsp that will call the custom tag.
    Note: You have to set your needed variable in request to make it visible to the jsp
    <%@ tag language="java" pageEncoding="UTF-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib uri="http://jakarta.apache.org/taglibs/log-1.0" prefix="log" %>
    <%@ attribute name="subtree"
              required="true"
              type="my.webapp.TreeObject" %>
    <%@ attribute name="subroot_index" required="true" type="java.lang.Integer"%>
    <log:debug category="my.webapp.ousearch.taglib" message="Tag library called, starting operations..." />
    <c:if test="${not empty subtree.children}">
         <c:set var="next_subtree_index" value="${subroot_index + 1}"/>
         <ul class="subtree" id="subtree-${subroot_index}">
         <log:debug category="${logcategory}" message="We have children, calling recursively tag library on them (next subtree index: ${next_subtree_index})..." />
         <c:forEach var="currentOUChild" items="${subtree.children}">
                    *<c:set var="_currentOUChild" value="${currentOUChild}" scope="request"/>*
                    *<c:set var="_next_subtree_index" value="${next_subtree_index}" scope="request"/>*
              *<c:import url="/WEB-INF/tags/outtree.jsp"/>*
              <c:set var="next_subtree_index" value="${next_subtree_index + 1}"/>
         </c:forEach>
         </ul>
    </c:if>
    </li>Here is the imported jsp (outtree.jsp):
    <%@ taglib prefix="ousel" tagdir="/WEB-INF/tags/ouselector" %>
    <ousel:outree subtree="${_currentOUChild}" subroot_index="${_next_subtree_index}"/>

  • Re: Using ScopeCache custom tag

    Hi, I am quite new to ColdFusion and I have a calendar that
    is quite slow due to the cfloops it uses to build the calendar. As
    the page does not change very often I wanted to use Raymond
    Camden's ScopeCache custom tag. However, for some reason the custom
    tag was not getting picked up from the custom tag folder on the
    server. I have successfully used components so have tried to
    convert the custom tag to a component but get the following error
    message:
    Routines cannot be declared more than once.
    The routine scope_Cache has been declared twice in the same
    file.
    This is the component:
    <!---
    Name : scopeCache
    Author : Raymond Camden ([email protected])
    Created : December 12, 2002
    Last Updated : November 6, 2003
    History : Allow for clearAll (rkc 11/6/03)
    : Added dependancies, timeout, other misc changes (rkc
    1/8/04)
    Purpose : Allows you to cache content in various scopes.
    Documentation:
    This tag allows you to cache content and data in various RAM
    based scopes.
    The tag takes the following attributes:
    name/cachename: The name of the data. (required)
    scope: The scope where cached data will reside. Must be
    either session,
    application, or server. (required)
    timeout: When the cache will timeout. By default, the year
    3999 (i.e., never).
    Value must be either a date/time stamp or a number
    representing the
    number of seconds until the timeout is reached. (optional)
    dependancies: This allows you to mark other cache items as
    dependant on this item.
    When this item is cleared or timesout, any child will also
    be cleared.
    Also, any children of those children will also be cleared.
    (optional)
    clear: If passed and if true, will clear out the cached
    item. Note that
    this option will NOT recreate the cache. In other words, the
    rest of
    the tag isn't run (well, mostly, but don't worry).
    clearAll: Removes all data from this scope. Exits the tag
    immidiately.
    disabled: Allows for a quick exit out of the tag. How would
    this be used? You can
    imagine using disabled="#request.disabled#" to allow for a
    quick way to
    turn on/off caching for the entire site. Of course, all
    calls to the tag
    would have to use the same value.
    License : Use this as you will. If you enjoy it and it helps
    your application,
    consider sending me something from my Amazon wish list:
    http://www.amazon.com/o/registry/2TCL1D08EZEYE
    --->
    <cfcomponent>
    <cffunction name="scope_Cache" access="public"
    returntype="string">
    <cfargument name="cachename" type="string"
    required="yes">
    <cfargument name="scope" type="string" required="yes">
    <cfargument name="timeout" type="string"
    required="yes">
    <cfprocessingdirective pageencoding="utf-8">
    <!--- allow for quick exit
    <cfif isDefined("arguments.disabled") and
    arguments.disabled>
    <cfexit method="exitTemplate">
    </cfif>
    <!--- Allow for cachename in case we use cfmodule --->
    <cfif isDefined("arguments.cachename")>
    <cfset arguments.name = arguments.cachename>
    </cfif>--->
    <!--- Attribute validation --->
    <cfif (not isDefined("arguments.name") or not
    isSimpleValue(arguments.name)) and not
    isDefined("arguments.clearall")>
    <cfthrow message="scopeCache: The name attribute must be
    passed as a string.">
    </cfif>
    <cfif not isDefined("arguments.scope") or not
    isSimpleValue(arguments.scope) or not
    listFindNoCase("application,session,server",arguments.scope)>
    <cfthrow message="scopeCache: The scope attribute must be
    passed as one of: application, session, or server.">
    </cfif>
    <!--- The default timeout is no timeout, so we use the
    year 3999. --->
    <cfparam name="arguments.timeout"
    default="#createDate(3999,1,1)#">
    <!--- Default dependancy list --->
    <cfparam name="arguments.dependancies" default=""
    type="string">
    <cfif not isDate(arguments.timeout) and (not
    isNumeric(arguments.timeout) or arguments.timeout lte 0)>
    <cfthrow message="scopeCache: The timeout attribute must
    be either a date/time or a number greather zero.">
    <cfelseif isNumeric(arguments.timeout)>
    <!--- convert seconds to a time --->
    <cfset arguments.timeout =
    dateAdd("s",arguments.timeout,now())>
    </cfif>
    <!--- create pointer to scope --->
    <cfset ptr = structGet(arguments.scope)>
    <!--- init cache root --->
    <cfif not structKeyExists(ptr,"scopeCache")>
    <cfset ptr["scopeCache"] = structNew()>
    </cfif>
    <cfif isDefined("arguments.clearAll")>
    <cfset structClear(ptr["scopeCache"])>
    <cfexit method="exitTag">
    </cfif>
    <!--- This variable will store all the guys we need to
    update --->
    <cfset cleanup = "">
    <!--- This variable determines if we run the caching.
    This is used when we clear a cache --->
    <cfset dontRun = false>
    <cfif isDefined("arguments.clear") and arguments.clear
    and structKeyExists(ptr.scopeCache,arguments.name) and
    thisTag.executionMode is "start">
    <cfif
    structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
    <cfset cleanup =
    ptr.scopeCache[arguments.name].dependancies>
    </cfif>
    <cfset structDelete(ptr.scopeCache,arguments.name)>
    <cfset dontRun = true>
    </cfif>
    <cfif not dontRun>
    <cfif thisTag.executionMode is "start">
    <!--- determine if we have the info in cache already
    --->
    <cfif structKeyExists(ptr.scopeCache,arguments.name)>
    <cfif
    dateCompare(now(),ptr.scopeCache[arguments.name].timeout) is -1>
    <cfif not isDefined("arguments.r_Data")>
    <cfoutput>#ptr.scopeCache[arguments.name].value#</cfoutput>
    <cfelse>
    <cfset caller[arguments.r_Data] =
    ptr.scopeCache[arguments.name].value>
    </cfif>
    <cfexit>
    </cfif>
    </cfif>
    <cfelse>
    <!--- It is possible I'm here because I'm refreshing. If
    so, check my dependancies --->
    <cfif structKeyExists(ptr.scopeCache,arguments.name) and
    structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
    <cfif
    structKeyExists(ptr.scopeCache[arguments.name],"dependancies")>
    <cfset cleanup = listAppend(cleanup,
    ptr.scopeCache[arguments.name].dependancies)>
    </cfif>
    </cfif>
    <cfset ptr.scopeCache[arguments.name] = structNew()>
    <cfif not isDefined("arguments.data")>
    <cfset ptr.scopeCache[arguments.name].value =
    thistag.generatedcontent>
    <cfelse>
    <cfset ptr.scopeCache[arguments.name].value =
    arguments.data>
    </cfif>
    <cfset ptr.scopeCache[arguments.name].timeout =
    arguments.timeout>
    <cfset ptr.scopeCache[arguments.name].dependancies =
    arguments.dependancies>
    <cfif isDefined("arguments.r_Data")>
    <cfset caller[arguments.r_Data] =
    ptr.scopeCache[arguments.name].value>
    </cfif>
    </cfif>
    </cfif>
    <!--- Do I need to clean up? --->
    <cfset z = 1>
    <cfloop condition="listLen(cleanup)">
    <cfset z = z+1><cfif z gt 100><cfthrow
    message="ack"></cfif>
    <cfset toKill = listFirst(cleanup)>
    <cfset cleanUp = listRest(cleanup)>
    <cfif structKeyExists(ptr.scopeCache, toKill)>
    <cfloop index="item"
    list="#ptr.scopeCache[toKill].dependancies#">
    <cfif not listFindNoCase(cleanup, item)>
    <cfset cleanup = listAppend(cleanup, item)>
    </cfif>
    </cfloop>
    <cfset structDelete(ptr.scopeCache,toKill)>
    </cfif>
    </cfloop>
    <cfreturn scope_Cache>
    </cffunction>
    </cfcomponent>

    Hi, thanks to both of you for your help. I reverted back the
    custom tag and it was picked up this time - I don't know what
    happened before. The functionality works as expected but I have hit
    another problem and I am hoping I can tap your combined ColdFusion
    wisdom to solve!!
    The calendar returns leave records for staff and filters the
    records using a querystring variable appended when the user clicks
    on a particular month. However, what members of staff the user sees
    depends on the data held in the users' session variables based on
    their authority. The reason I wanted to use caching is because the
    page takes a good ten seconds to run because of the use of cfloops
    for the members of staff and the days of the week to dynamically
    build the page. Using the custom tag would have worked if all
    members of staff saw the same calendar data and could only see one
    month. Can you see anyway I can speed up the page and do you think
    caching is the way forward here?

  • Assigning bean property to custom tag's attribute

    1. The #{beanName.property} notation can only be used inside JSF tags.
    2. The attributes of custom tags does not accept embedded tags.
    e.g. <prefix:tagName attrib1="<jsftag>">
    I need to assign a bean's property to the attrib1 attribute. how do I do this?

    Alternatively, how can I assign the value of a bean property to a variable?
    e.g.
    <%
    int var=<bean.property>
    %>
    I can use the variable on the custom tag like this:
    <prefix:tagName attrib1="<%=var%>"> OR
    But this may not be the best solution though because I have to use scriptlets...

  • Further custom tag travails...

    All,
              I have posted previously that custom tags can not handle JSP in their
              attributes. This turns out to be incorrect. In fact, they can, but
              there are some serious bugs when using it which made it seem like they
              couldn't.
              The following jsp works perfectly fine:
              <% String myAttribute="Thusly my attribute is" %>
              <mytaglib:mytag myattribute="<%=myAttribute%>" />
              However, the following jsp will break:
              <mytaglib:mytag myattribute="<%="Thusly my attribute is"%>" />
              because the jsp parser thinks that the second quote is ending the
              attribute instead of starting a string. Hence, the jsp compiler sees:
              <mytaglib:mytag myattribute="<%="
              and then some garbage including a > which it assumes means that mytag is
              closing. This really, really screws things up...
              The exact error I get is:
              /tagtester.jsp(38): no corresponding open tag for tag extension close:
              Now, I also get an error if I do something like this:
              <% String myAttribute="Thusly my attribute is" %>
              <mytaglib:mytag myattribute=" <%=myAttribute%>" />
              Where I have put some one space before the jsp. The error message is
              different:
              /_tagtester.java:84: String not terminated at end of line.
              Looking at the jsp .java file indicates that this also is a parsing
              problem...
              Is weblogic aware of these issues? Will they be fixed in sp6?
              Thanks,
              Carson
              

    This is a consequence of the JSP spec and how it parses attribute values.
              Similar issues occur using standard boilerplate XML.
              The easy way around these problems is to use the fact that both single and
              double quotes are allowable in XML attribute values so try using code like
              this instead:-
              <mytaglib:mytag myattribute='<%="Thusly my attribute is"%>' />
              Then you will not get any JSP compilation errors.
              Regards
              James
              James Strachan
              =============
              email: [email protected]
              web: http://www.metastuff.com
              "Cameron Purdy" <[email protected]> wrote in message
              news:[email protected]...
              > I saw this refererred to (in a different context altogether) in some W3
              > documents referring to issues with input type attributes and xml ... I
              think
              > in the context of XSL. In other words, I am not sure if it is a WL bug or
              > just something that you can not do. I know that isn't the answer that you
              > are looking for ;-( ... perhaps you can escape some of those quotes.
              >
              > --
              >
              > Cameron Purdy
              > [email protected]
              > http://www.tangosol.com
              > WebLogic Consulting Available
              >
              >
              > "Carson Gross" <[email protected]> wrote in message
              > news:[email protected]...
              > > All,
              > >
              > > I have posted previously that custom tags can not handle JSP in their
              > > attributes. This turns out to be incorrect. In fact, they can, but
              > > there are some serious bugs when using it which made it seem like they
              > > couldn't.
              > >
              > > The following jsp works perfectly fine:
              > >
              > > <% String myAttribute="Thusly my attribute is" %>
              > > <mytaglib:mytag myattribute="<%=myAttribute%>" />
              > >
              > > However, the following jsp will break:
              > >
              > > <mytaglib:mytag myattribute="<%="Thusly my attribute is"%>" />
              > >
              > > because the jsp parser thinks that the second quote is ending the
              > > attribute instead of starting a string. Hence, the jsp compiler sees:
              > >
              > > <mytaglib:mytag myattribute="<%="
              > >
              > > and then some garbage including a > which it assumes means that mytag is
              > > closing. This really, really screws things up...
              > >
              > > The exact error I get is:
              > >
              > > /tagtester.jsp(38): no corresponding open tag for tag extension close:
              > >
              > > Now, I also get an error if I do something like this:
              > >
              > > <% String myAttribute="Thusly my attribute is" %>
              > > <mytaglib:mytag myattribute=" <%=myAttribute%>" />
              > >
              > > Where I have put some one space before the jsp. The error message is
              > > different:
              > > /_tagtester.java:84: String not terminated at end of line.
              > >
              > > Looking at the jsp .java file indicates that this also is a parsing
              > > problem...
              > >
              > > Is weblogic aware of these issues? Will they be fixed in sp6?
              > >
              > > Thanks,
              > > Carson
              > >
              >
              >
              

  • Custom Tags in JSP

    I am new to using custom tags. Is there a nice book or site which I could read on custom tags.
    Also, I kind of understand custom tags but not completely confident.
    I have a JSP that uses two custom tags, flight and segment. Basically, goes through each segment with flight tag and prints out attribute of segment with Segment tag. The code looks like this.
    <flifo:flight isParent="true" fromParent="true" >
              <td bgcolor="<%=bgcolor%>" width="94" valign="top" class="t7">
                        <%-- Print FLIGHT NUMBER --%>
                   Flight
                        <b><flifo:segment fromParent="true" attribute="flight_num" /></b>
                        <br>
    </flifo:flight>
    In the above code I just have flight_num but there are other attributes that it prints out. I want to check an attribute in segment and if it is ture then display some of the tags. How can I do it?

    This has helped me a lot in the past:
    http://java.sun.com/developer/Books/javaserverpages/cservletsjsp/chapter14.pdf
    ... and the book it's extracted from is very good too.

  • Setter method not getitng called in the custom tag

    Hi,
    I have written a custom tag and I have declared an attribute in the tld file and have specified the setter method for the same in the java tag file but that setter method is not getting called...for rest of the attributes, the methods are getting called and not just for one!! any idea what could be the problem....
    Regards
    Deepak Saini

    Do you have a getter method to match that property?
    Post some example code - what does your tld define for this property, and what get/set methods have you defined for it?

  • Custom Tag Calling

    Can someone describe the process that JSF Servers use to call a tag. I'm writing a custom tag (actually a library of them) and I need one to call another tag.
    in other words:
    instead of:
    <my:tag1> <my:tag2>
    i'm creating a class called my:tag3, that will call both my:tag1 and my:tag2.
    That's the short of it, my:tag3 is actually going to do some nifty stuff on the back end, but thats not required for this question. So, how do I get my:tag3's encodeEnd(...) function to create my:tag1 and my:tag2 in the javacode?
    Thanks for any help.

    I'm writing a custom tag [...] and I need one to call another tag.
    in other words:
    instead of:
    <my:tag1> <my:tag2>
    i'm creating a class called my:tag3, that will call both my:tag1 and my:tag2.Do you really need JSP tags for <my:tag1> and <my:tag2>? A tag is just one way of creating a JSF component.
    Another way is to associate (in faces-config.xml) a JSF component (of type UITag3) with the tag <my:tag3>. This UITag3 will have 2 sub-components, of type UITag1 and UITag2 and these components are created (and added to the UITag3 component) in the setProperties() method in UITag3Tag.
    For example:
    public class MyTag3Tag extends UIComponentTag {
        public String getComponentType() { return "my.tag3"; }
        public String getRendererType() { return null; }
        protected void setProperties(UIComponent component) {
            super.setProperties(component);
            List children = component.getChildren();       
            UITag1 child1 = new UITag1();
            child1.setValue("XXX");
            children.add(child1);
            UITag2 child2 = new UITag2();
            child2.setValue("YYY");
            children.add(child2);
    }Geoff Rimmer

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

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

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

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

Maybe you are looking for

  • Problem with port

    Hi, I've created  a port with transction "idx1" in the client 100. But this port does not display in transaction "we 20"(Partner profiles)in the client "100" but it displayes in the client 000. Can anybody help me please? Thanks for your help. Regard

  • Getting error in Workflow

    Hi Experts, I am getting the error when the step is executed the error is 'Work item 000000004013: Object CL_HRASR00_WF_COMPONENTS method WI_EXECUTION_VIA_R3_INBOX cannot b'... I used the Standard Task 'TS17900100' and i maintained the Program Exit a

  • Abort Status in Monitoring Initial Load Object - SERNR_CONFIG From R/3

    Hi Experts, Currently we are replicating Equipement from R/3 to CRM. Now we want to replicate only Serial Number withoutEquipment View. For this I Activated the Object Sernr_config and started for Initial download. When i monitored the replication it

  • Links from XML

    Hello everybody. I'm working with a XML driven photo gallery that looks like this: <gallery name="Birthday"> <image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/> <image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Landscape"/>

  • I have legally purchased and downloaded FLAC music files online, but iTunes will not recognise them.  What can I do?

    I have legally purchased and downloaded FLAC music files online, but iTunes will not recognise them.  I'm working on a PC. Can anybody help, please?