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.

Similar Messages

  • Tags not evaluating expression

    When the jsp executes with a single expression in the defaultValues attribute, it evaluates fine.
    eg>
    <ft:phone namePrefix="representative" defaultValues="<%=appeal.getRepresentative_area_code()%>"/>
    // area code is set to 111
    produces
    <input size="3" type="text" maxlength="3" name="representative_area_code" value="111">
    <input size="3" type="text" maxlength="3" name="representative_phone_prefix" value="">
    <input size="4" type="text" maxlength="4" name="representative_phone_suffix" value="">
    which is the expected response, Yet when I do
    <ft:phone namePrefix="representative" defaultValues="<%=appeal.getRepresentative_area_code()%>;555"/>
    I get
    <input size="3" type="text" maxlength="3" name="representative_area_code" value="<%=appeal.getRepresentative_area_code()%>">
    <input size="3" type="text" maxlength="3" name="representative_phone_prefix" value="555">
    <input size="4" type="text" maxlength="4" name="representative_phone_suffix" value="">
    like it doesn't evaluate the embedded expression.
    Also is there a better way to pass in the default values then using a semi colon delimited list. Perhaps pass in a hashmap with attributes set?
    Here is the tld file:
    // tld begin
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>formtags</shortname>
    <info>WCB Tags for Forms</info>
    <tag>
    <name>phone</name>
    <tagclass>wcb.common.jsptags.PhoneTag</tagclass>
    <bodycontent>empty</bodycontent>
    <info>This tag puts 3 input boxes for phone numbers.</info>
    <attribute>
    <name>namePrefix</name>
    <required>false</required>
    <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
    <name>defaultValues</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    //end tld
    //tag definition PhoneTag.java
    package wcb.common.jsptags;
    * This tag will output three input text fields that are used to input phone numbers.
    * Creation date: (08/20/2002 2:05:00 PM)
    * @author: Travis Leippi, WCB
    * Changes:
    * Author                    Date               Change
    * Travis Leippi          2002-08-20          Initial revision
    import java.util.StringTokenizer;
    import javax.servlet.jsp.JspTagException;
    import javax.servlet.jsp.JspWriter;
    import javax.servlet.jsp.tagext.TagSupport;
    public class PhoneTag extends TagSupport {
         private class PhoneField {
              String strField = null;
              int intSize;
              String strValue = null;
              public PhoneField(String argField, int argFieldSize) {
                   strField = argField;
                   intSize = argFieldSize;
                   strValue = new String();
              public PhoneField(String argField, int argFieldSize, String argValue) {
                   strField = argField;
                   intSize = argFieldSize;
                   strValue = argValue;
         private String strNamePrefix = null;
         private String strDefaultValues = null;
         private PhoneField[] objFields =
              { new PhoneField("area_code", 3), new PhoneField("phone_prefix", 3), new PhoneField("phone_suffix", 4)};
         * doStartTag is called by the JSP container when the tag is encountered
         public int doStartTag() {
              try {
                   JspWriter out = pageContext.getOut();
                   // Iterate through the elements of strFields
                   // printing out a textbox for each
                   if (strDefaultValues != null) {
                        setupFieldValues();
                   for (int i = 0; i < objFields.length; i++) {
                        out.print("<input size=\"");
                        out.print(objFields.intSize);
                        out.print("\" type=\"text\" maxlength=\"");
                        out.print(objFields[i].intSize);
                        out.print("\" name=\"");
                        if (strNamePrefix != null) {
                             out.print(strNamePrefix);
                        out.print(objFields[i].strField + "\" value=\"");
                        if (objFields[i].strValue != null) {
                             out.print(objFields[i].strValue);
                        out.print("\">");
                        out.println();
              } catch (Exception ex) {
                   throw new Error("All is not well in the world.");
              // Must return SKIP_BODY because we are not supporting a body for this
              // tag.
              return SKIP_BODY;
         * doEndTag is called by the JSP container when the tag is closed
         public int doEndTag() throws JspTagException {
              return SKIP_BODY;
         * Gets the strNamePrefix
         * @return Returns a String
         public String getNamePrefix() {
              return strNamePrefix;
         * Sets the strNamePrefix
         * @param strNamePrefix The strNamePrefix to set
         public void setNamePrefix(String strNamePrefix) {
              this.strNamePrefix = strNamePrefix + "_";
         * Gets the strValues
         * @return Returns a String
         public String getDefaultValues() {
              return strDefaultValues;
         * Sets the strValues
         * @param strValues The strValues to set
         public void setDefaultValues(String strDefaultValues) {
              this.strDefaultValues = strDefaultValues;
         private void setupFieldValues() {
              StringTokenizer st = new StringTokenizer(strDefaultValues, ";");
              for (int i = 0; i < objFields.length && st.hasMoreTokens(); i++) {
                   objFields[i].strValue = st.nextToken();
    // end java

    The expression needs to be a legal java expression that evaluates to a string. Try:
    <ft:phone namePrefix="representative" defaultValues='<%=appeal.getRepresentative_area_code() + ";555"'%>/>If that doesn't work, go with
    <%String st = appeal.getRepresentative_area_code() + ";555";%>
    <ft:phone namePrefix="representative" defaultValues="<%=st%>/>

  • Can I write Design-time for JSP custom tag(not JSF components)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • 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

  • JSP Custom tag not working correctly for multiple users

    I am doing some support work for an existing web system. When doing single user access (a custom tag is called within the JSP); the output of the Custom tag is fine. However, during multiple user access to the JSP, as I could see on the log files, 2 users access the custom tag at exactly the same time- the output of one of the users was incorrect. The custom tag btw, uses TreeMap, Stringbuffer and does not have a body, only attributes passed to it. It takes an input file and a Hashmap as input attributes and it sets a string in the page context which is later being used in the JSP. No error is logged, its just that the string produced(placed in the page context) is incorrect. This only happens when this tag is called at same time(when multiple users accessing the page) Has anyone encountered this problem? Is there a known pooling/thread problem with custom tags?

    in a servlet/jsp (a jsp is compiled into a servlet),
    the class atrributes are shared. only the
    variables declared in the doservice (doGet or doPost)
    method are threadsafe.
    post your jsp plzhere's the snippet of the jsp code:
    <%@ page language="java"
    errorPage="Error.jsp"
    autoFlush="false"
    buffer="128kb"
    import="java.text.*,
    java.math.BigDecimal,
    java.rmi.RemoteException,
    java.util.*,
    java.io.*,
    %>
    <%@ include file="Secure.jsp" %>
    // a set of request.getParameter are being called here
    HashMap myMap = new HashMap();
    myMap.put(xmlDPhoneNumber, dPhoneNumber);
    myMap.put(xmlDPhoneType, "D");
    myMap.put(xmlDPhoneExt, dExtension);
    myMap.put(xmlDPhoneDigits, dPhoneDigits);
    // other myMap putting of key values are called here
    %>
    <test:applyCustomerSearchValues id="resultXml" xmlTemplate="/xml/message/CustomerUpdateRequest.xml"
    xmlMap="<%= myMap %>" />
    <test:transformXMLString id="customerUpdateRequest"
    xmlString="<%= resultXml.toString() %>"
    xslFileName="/xsl/message/CustomerCreateRequest.xsl"
    paramMap="<%= PMap %>"/>
    now here's the thing: the xml produced by test:applyCustomerSearchValues is resultXml which is used in test:transformXMLString. I got no problem with the output of test:transformXMLString. I am sure that a phone number is being passed into the former as part of the HashMap key-value. However when test:applyCustomerSearchValues is called when 2 users access the jsp, it seems like the the first xml produced does not have the phone number in it - but the other has it. The xml is OK for both users, its just that the values of the HashMap do not seem to be passed correctly into the xml produced.
    --- here's the snippet of the log, the first httpWorkerThread-80-6 does not have the phone number, however the second one-httpWorkerThread-80-7 has the phone number. The first one should also have a phone number as in the start of the log, the number was listed, but as the system called the test:applyCustomerSearchValues tag, the number was not included. There are different phone numbers for the 2 users. The odd thing here is, the userID which is the 'LastUpdatedBy' element has been set correctly. The userID is being fetched from a session attribute while the phone number is fetched from a request parameter, both are being placed in the HashMap attribute passed to the custom tag.
    2007-06-05 10:55:41,954 DEBUG [httpWorkerThread-80-6] (?:?) - ApplyCustomerSearchValuesTag : String produced is :<Values><Customer>
    <Status>
         <CustomerType></CustomerType>
         <FirstContactDate>2007-06-05</FirstContactDate>
         <StatusFlags>
              <Fraud>N</Fraud>
              <BadCheck>N</BadCheck>
              <BadCredit>N</BadCredit>
              <DoNotMerge>N</DoNotMerge>
              <ARHoldRefundCheck>N</ARHoldRefundCheck>
         </StatusFlags>
         <LastUpdatedDateTime>2007-06-05 10:55:41</LastUpdatedDateTime>
         <LastUpdatedBy>5555</LastUpdatedBy>
         <OPAlertClass></OPAlertClass>
         <MailListStoreID></MailListStoreID>
         <OriginatingSource>CSA</OriginatingSource>
    </Status>
    <DPhone id="D">
         <DPhoneNumber></DPhoneNumber>
         <DPhoneDigits></DPhoneDigits>
         <DPhoneType></DPhoneType>
         <DExtension></DExtension>
         <DAreaCode></DAreaCode>
         <DPhoneCountryCode></DPhoneCountryCode>
    </DPhone>
    </Customer>
    </Values>
    2007-06-05 10:55:41,954 DEBUG [httpWorkerThread-80-7] (?:?) - ApplyCustomerSearchValuesTag : String produced is :<Values><Customer>
    <Status>
         <CustomerType>N</CustomerType>
         <FirstContactDate>2007-06-05</FirstContactDate>
         <StatusFlags>
              <Fraud>N</Fraud>
              <BadCheck>N</BadCheck>
              <BadCredit>N</BadCredit>
              <DoNotMerge>N</DoNotMerge>
              <ARHoldRefundCheck>N</ARHoldRefundCheck>
         </StatusFlags>
         <LastUpdatedDateTime>2007-06-05 10:55:41</LastUpdatedDateTime>
         <LastUpdatedBy>1840</LastUpdatedBy>
         <OPAlertClass></OPAlertClass>
         <MailListStoreID></MailListStoreID>
         <OriginatingSource>CSA</OriginatingSource>
    </Status>
    <DPhone id="D">
         <DPhoneNumber>(123) 123-4788</DPhoneNumber>
         <DPhoneDigits>1231234788</DPhoneDigits>
         <DPhoneType>D</DPhoneType>
         <DExtension></DExtension>
         <DAreaCode>123</DAreaCode>
         <DPhoneCountryCode>US</DPhoneCountryCode>
    </DPhone>
    </Customer>
    </Values>
    Message was edited by:
    Mutya

  • Calling jsp custom tag from jsp expression

    hi there,
    I have a problem calling oracle(or any other) custom tag from inside a jsp expression.(i.e.)embeding <jbo:tagname...> into <%......%>.
    For example:
    I need to get the value of a jsp parameter, but the parameter name is dynamic (retrieved from a DataBase)
    So I though it would be something link that:
    <%=request.getParameter(<jbo:ShowValue datasource="ds" dataitem="ParamName" ></jbo:ShowValue>) %>
    where <jbo:ShowValue is an Oracle custom tab that retrieves the value of a certain dataItem(certain field).
    But it does not work.........
    if any body can tell me how to overcome, or work around it, I'll be so pleased.
    Regards,
    Remoun Anwar

    Hi,
    You get the custom tag output into a hidden variable (say 'key') and use the request.getParameter("key")
    Hope u got the answer...
    Regards
    ravi

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

  • Using custom tags - not a "how to do my homework" question.

    Hi, I havn't done a heap of JSP and I'm experimenting with custom tags. I understand this may be elementary to some. I also expect there is probably some ready-to-go libary out there that would do this for me, I just wanted to do it from scratch, mostly as a learning exercise.
    So I've got a servlet which runs a query, and sends two arrays of objects to a JSP, one is an array of column headings, the other is an array of arrays representing the rows of data.
    The intention of the JSP is simply to display the data in a table.
    I guess one question I have is:
    What is the best way to apply styles to my table? Obviously I don't want to have to recompile the tag code to add/change styles. Is the best way to do it is to have another property of the tag that accepts the name of a style class?
    So when I place the tag in my JSP it will looks like <test:report-table headings="..." rows="..." style="blue"/> and in the tag code it will look something like out.write("<table class=\" + classname + \"");I appreciate any comments on how good/bad my code/theory is. Any recomended additions/omissions?
    The tag in the JSP looks like this.
            <test:report-table
                headings="<%= (Object[])request.getAttribute(\"columns\")%>"
                rows="<%= (Object[])request.getAttribute(\"rows\")%>"
            />The tag class looks like this.
    bar.foo.test;
    import java.io.IOException;
    import javax.servlet.jsp.JspWriter;
    import javax.servlet.jsp.tagext.TagSupport;
    public class ReportTable extends TagSupport
        private Object[] headings;
        public Object[] getHeadings() { return headings; }
        public void setHeadings(Object[] o) { this.headings = o; }
        private Object[] rows;
        public Object[] getRows() { return rows; }
        public void setRows(Object[] o) { this.rows = o; }
        public int doStartTag()
            JspWriter out = pageContext.getOut();
            try
                out.write("<table>");
                out.write("<tr>");
                for (int i = 0; i < headings.length; i++ )
                    out.write("<td>" + headings[i] + "</td>");
                out.write("</tr>");
                for (int i = 0; i < rows.length; i++)
                    out.write("<tr>");
                    Object[] row = (Object[])rows;
    for (int j = 0; j < row.length; j++)
    out.write("<td>" + row[j] + "</td>");
    out.write("</tr>");
    out.write("</table>");
    catch (IOException e)
    e.printStackTrace();
    return 0;
    The tag definition in my tld looks like this
        <tag>
            <name>report-table</name>
            <tagclass>bar.foo.ReportTable</tagclass>
            <bodycontent>empty</bodycontent>
            <info> Report Table </info>
            <attribute>
                <name>headings</name>
                <required>true</required>
                <rtexprvalue>true</rtexprvalue>
                <type>java.util.Object[]</type>
            </attribute>
            <attribute>
                <name>rows</name>
                <required>true</required>
                <rtexprvalue>true</rtexprvalue>
                <type>java.util.Object[]</type>
            </attribute>
        </tag>

    TimSparq wrote:
    Cool, thanks for the input/advice, evanfets.
    Yeah, my plan was now that I have a basic understanding of the mechanics of what's going on in the tags, I'll go and look into what ready-made stuff there is out there (like you suggest, JSTL).
    And thanks for the advice regarding styles, exceptions and the return value. All appreciated.
    I'll be taking a look into the tag files too.
    Thanks again.Just another option on the styles. One thing I have done in similar situations is to generate a lot of class names and automatically apply them to the correct spot. Example:
    <table class="reportTable">
      <thead class="reportTableHead">
        <tr class="rtHeadRow"><th class="rtOddColumn">...</th><th class="rtEvenColumn">...</th></tr>
      <thead>
      <tbody class="reportTableBody">
        <tr class="rtOddRow"><td class="rtOddColumn">...</td><td class="rtEvenColumn">...</td></tr>
        <tr class="rtEvenRow"><td class="rtOddColumn">...</td><td class="rtEvenColumn">...</td></tr>
      </tbody>
    </table>This gives the web developer a large selection of selectors to work on:
    table.reportTable -> Edit the entire table
    table.reportTable tr -> Configure all rows in the table
    table.reportTable tr.rtOddRow -> Configure the odd rows in the table
    table.reportTable tr.rtOddRow td.rtEvenColumn -> Configure just the even columns in an odd row
    etc...
    You just communicate the class names that can be used and then the web designer generates a CSS to fit his needs.

  • CQ5 custom tag not sending cookie set in response when using IE10

    Hi,
    I have some custom code that will create a cookie and send it to the browser. This code works for Chrome, Firefox and IE9, but for some reason in IE10 the cookie will not even get sent in the response headers!
    The code that creates the cookie is just Java standard:
                   Cookie cookie = new Cookie("recently-viewed-producs-cookie", encryptedCookie);
                    cookie.setPath("/");
                    cookie.setDomain(getSlingRequest().getServerName());
                    cookie.setMaxAge(COOKIE_AGE_IN_SECONDS);
                    getSlingResponse().addCookie(cookie);
    Does anybody have an idea why this could happen? I encrypt the contens of my cookie, so there are no invalid characters (I believe).
    Other cookies created by CQ5 are sent and the browser saves them. I checked the cookie settings for the browser and it is set to accept everything, including session cookies.
    Any suggestions are welcome.
    Blanca

    BTS.MessageType is typically set by one of the Disassemblers.
    BTS.Operation has nothing to do with the Receive Port/Location and is set by the Engine only when coming from an Orchestration Port.
    But, you can set any Property in any Stage with a custom Pipeline Component as you've found.
    "Exception of type 'Microsoft.BizTalk.Message.Interop.BTSException' was thrown."
    There's usually a lot more to the stack trace.  You'll have to include the whole thing.
    Finally, what benefit do you expect from adding the ESB layer?  This is pretty trivial with an Orchestration.

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

  • In custom tag, trying to include JSP Page, not processing tags

    Now I have this in the correct forum!
    I am in a custom tag where one of my attributes (myIncludePage) is the name of another JSP file that I want to include. So, in my custom tag doStartTag() I have:
    out.println("<td>");
    pageContext.include(myIncludePage);
    out.println("</td>");
    The included page is rendered with the custom tags in it not processed (I see my tags in the generated HTML)
    How do I get the included page to be "processed"?
    Thanks in advance,
    Sam

    Sorry, wrong forum, should be in the JSP forum. Hope someone can still help!

  • In custom tag, trying to include JSP page, not processing JSP tags

    I am in a custom tag where one of my attributes (myIncludePage) is the name of another JSP file that I want to include. So in my custom tag doStartTag() I have:
    out.println("<td>");
    pageContext.include(myIncludePage);
    out.println("</td>");
    The included page is rendered with the custom tags in it not processed (I see my tags in the generated HTML)
    How do I get the included page to be "processed"
    Thanks in advance
    Sam

    Sorry, wrong forum, should be in the JSP forum. Hope someone can still help!

  • Customer JSF Component Value Expression not work

    why my customer tag not work,
    in my jsp
    <q:my formatString="yyyy/mm/dd" current="#{LoginBean.date}"></q:my>the isLiteralText() always return true, and I can't get the correct value, #{LoginBean.date} is returned.
    bellow is my tag source.
    can anyone help me.
    package jsf;
    import javax.el.ValueExpression;
    import javax.faces.component.UIComponent;
    import javax.faces.webapp.UIComponentELTag;
    public class MyCustomerTag extends UIComponentELTag {
        private String formatString;
        @Override
        public String getComponentType() {
            return "COMPONENT_TYPE";
        @Override
        public String getRendererType() {
            return "COMPONENT_TYPE";
        @Override
        public void release() {
            super.release();
            setFormatString(null);
        @Override
        protected void setProperties(UIComponent component)  {
            if (!(component instanceof UIDatePicker))
                throw new IllegalArgumentException("Component "+
                    component.getClass().getName() +" is no UIDatePicker");
            component.setValueExpression("current", current);
            System.out.println(current.getExpressionString());
            System.out.println(current.isLiteralText());
            System.out.println((String) component.getAttributes().get("current"));
         * @return the formatString
        public String getFormatString() {
            return formatString;
         * @param formatString the formatString to set
        public void setFormatString(String formatString) {
            this.formatString = formatString;
        private ValueExpression current;
         * @return the value
        public ValueExpression getCurrent() {
            return current;
         * @param value the value to set
        public void setCurrent(ValueExpression current) {
            this.current = current;
    }

    I do not know what your native is, but there's quite a huge difference between "custom" and "customer". Look it up in your dictionary.

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

  • Custom tag library problem

    I created a workspace with two projects in it.
    In the first project I realized a tag library with its deployment descriptor.
    In the second project I realized a .war component with a jsp that uses the tag in the library.
    In the .war deployment descriptor I choosed the library deployment descriptor in the Profile Dependencies page.
    When I deploy my .war (alone or in an .ear) file I properly find the library .jar file in it but in this .jar file there isn't any .class file.
    Where are my tag handlers? If I deploy the tag library alone the .class files are there so I can replace the library .jar file created in the .ear and all works properly.
    I tried creating a third project that include the .war in its .ear, but I cannot include my tag library .jar because it's not listed in the Application Assembly page.
    Thank you
    Andrea Mattioli

    I found the bug! Its in greeting.jsp ...
    Instead of
    <tw:greeting />
    I typed....
    <tw.greeting />
    which resulted in the the custom tag not being called! That was the source of my problem.
    Thanks,
    Joe!

Maybe you are looking for

  • Office 2013 installed with KB2817430, windowsupdate still finds KB2850036. difference between KB2817430 and KB2850036

    Hi, I've made a silent Office 2013 installer with /admin and put SP1 MSP's in the updates folder. After deployment under installed updates it shows: Service Pack 1 for Microsoft Office 2013 (KB2817430) 32-Bit Edition But when I check for new updates,

  • Original software with G4 400

    I have been trying to find out exactly what software comprised the original bundle that came with the PowerMac G4 400. This has turned out to be a lot more difficult than I had expected, even though have the original packaging and documents. I own on

  • Existing balance

    Have an existing balance and when I buy a song it want deduct from existing balance.

  • File to file transfer

    hai   i need the steps to be done for the scenerio file to file transfer,   as if i am transfering a file from one R/3 to another R/3 system. what are the configuarion that is to be done for it? plz send me the detail steps. thx in advance. its urgen

  • Disparity in reported size on same content on 2 disks

    I have cc cloned a folder from one disk to another, just before I deleted the content from the original, I checked to see it had all copied with a get info on each file. There would appear to be nothing missing but the file size of the two is massive