Quotes in attributes in a custom tag are failing in weblogic 5.1

This seems to be on and off behaviour but when my tags are failing I
          have traced it down to the fact that my attributes have quotes in
          them. (By the way I'm running weblogic 5.1 with service pack 10)
          ie:
          <a:foo bar="<%=req.getParemeter("biz")%>">. Escaping the internal
          quotes doesn't seem to help the matter at all.
          After many hours of racking my brain to try and figure out why the
          tags were failing I found a message somewhere in this group which said
          they had the same issue and worked around it by using single qoutes
          around any attribute with a qoute in it ie: <a:foo
          bar='<%=req.getParemeter("biz")%>'>. This work around worked for me as
          well but leaves me with 2 important questions.
          a) According to weblogic this is issue (and I quote from their
          website) "CR 34389: Escaping Quotes was not working in the value tag
          for JSP params; The JSP spec says that quotations (") are to be
          escaped with \" . Fixed quoting problems for double and single quotes.
          " This was supposedly fixed in service pack 9, I'm running service
          pack 10 so what gives???
          b) Since this single qoute thing is not in the JSP spec if I keep it
          like this to get my tags working under my current setup and then we
          eventually migrate to weblogic 6x is there a risk all my tags will
          break?
          

This seems to be on and off behaviour but when my tags are failing I
          have traced it down to the fact that my attributes have quotes in
          them. (By the way I'm running weblogic 5.1 with service pack 10)
          ie:
          <a:foo bar="<%=req.getParemeter("biz")%>">. Escaping the internal
          quotes doesn't seem to help the matter at all.
          After many hours of racking my brain to try and figure out why the
          tags were failing I found a message somewhere in this group which said
          they had the same issue and worked around it by using single qoutes
          around any attribute with a qoute in it ie: <a:foo
          bar='<%=req.getParemeter("biz")%>'>. This work around worked for me as
          well but leaves me with 2 important questions.
          a) According to weblogic this is issue (and I quote from their
          website) "CR 34389: Escaping Quotes was not working in the value tag
          for JSP params; The JSP spec says that quotations (") are to be
          escaped with \" . Fixed quoting problems for double and single quotes.
          " This was supposedly fixed in service pack 9, I'm running service
          pack 10 so what gives???
          b) Since this single qoute thing is not in the JSP spec if I keep it
          like this to get my tags working under my current setup and then we
          eventually migrate to weblogic 6x is there a risk all my tags will
          break?
          

Similar Messages

  • Why it cannot find the setter method for the attribute in my custom tag?

    Hi, i have a custom tag like this:
    <robin:category tModelKey="#{data.tModelKey}" > </robin:category>And in my tld file:
    <tag>
          <name>category</name>
         <tag-class>category.component.HtmlCategoryTag</tag-class>
         <attribute>
             <name>tModelKey</name>
             <required>false</required>
             <rtexprvalue>false</rtexprvalue>
             <type>java.lang.String</type>
         </attribute>
    </tag>
    ........................................and in my HtmlCategoryTag Class
    public class HtmlCategoryTag extends HtmlPanelGridTag
    private String tModelKey;
    public String getTModelKey()
    return tModelKey;
    public void setTModelKey(String modelKey)
    tModelKey = modelKey;
    So,you see,generally speaking,to use a custom tag,we only to write a tag class,declare it in the tld file,nothing more.
    What fints me is that if i change "tModelKey" to "test" and change the according part in the tag class , tld file and jsp file, the "setter not found" problem no longer exists,everything goes right!!!.
    So why this happens? please help:)
    Best Regards:)
    Robin

    Then you also need to create a UI element that extends HtmlPanelGrid
    that has a tModelKey member and getters/setters. That object will hold
    the information so that you can use it in your bean.Whoops... ignore that! Sorry. Attributes are simply stored in the component map component.getAttributes().
    Add to your Tag class:
    public void setProperties(UIComponent component) {
        super.setProperties(component);
        Tags.setString(component, "tModelKey", tModelKey);
    public void release() {
        // see above
    }Where Tags.java is:public class Tags {
        public static void setString(UIComponent component, String attributeName, String attributeValue) {
            if (attributeValue != null) {
                if (UIComponentTag.isValueReference(attributeValue)) {
                    setValueBinding(component, attributeName, attributeValue);
                } else {
                    component.getAttributes().put(attributeName, attributeValue);
        public static void setValueBinding(UIComponent component, String attributeName, String attributeValue) {
            FacesContext context = FacesContext.getCurrentInstance();
            Application app = context.getApplication();
            ValueBinding vb = app.createValueBinding(attributeValue);
            component.setValueBinding(attributeName, vb);
    }

  • How to pass a server side value to an attribute of a custom jsp tag

    Hi All:
    I needed to passed an integer value from the following code:
    <%=ic.getTotalNumOfRecords()%>
    to an attribute of a custom tag
    <inquiry:tableClaimHistory numberOfRecords="5" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    The function getTotalNumOfRecords returns an int.
    The attribute numberOfRecords expects an string.
    Here are the different ways I tried in a jsp page but I get also the following errors:
    1.)
    >
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords=<%=ic.getTotalNumOfRecords()%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    Error Message:
    claimHistoryView.jsp:190:3: Unterminated tag.
    <inquiry:tableClaimHistory numberOfRecords=<%=ic.getTotalNumOfRecords()%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    2.)
    >
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    Error Message:
    claimHistoryView.jsp:190:4: The required attribute "numberOfRecords" is missing.
    <inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    3.)
    >
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords="<%ic.getTotalNumOfRecords();%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    Error Message:
    java.lang.NumberFormatException: For input string: "<%ic.getTotalNumOfRecords();%>"
    4.)
    >
    <%@ include file="../common/page_imports.jsp" %>
    <%
    int records1 = ic.getTotalNumOfRecords();
    Integer records2 = new Integer(records1);
    String numberOfRecords2 = records2.toString();
    %>
    <inquiry:tableClaimHistory numberOfRecords="<%numberOfRecords2;%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    error message:
    java.lang.NumberFormatException: For input string: "<%numberOfRecords2;%>"
         at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
         at java.lang.Double.valueOf(Double.java:447)
         at java.lang.Double.(Double.java:539)
         at com.DisplayTableClaimHistoryTag.displayTable(DisplayTableClaimHistoryTag.java:63)
    5.)
    >
    <%
                   int records1 = ic.getTotalNumOfRecords();
                   Integer records2 = new Integer(records1);
                   String numberOfRecords2 = records2.toString();
              %>
              <inquiry:tableClaimHistory numberOfRecords=<%numberOfRecords2;%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    error message:
    claimHistoryView.jsp:194:3: Unterminated tag.
              <inquiry:tableClaimHistory numberOfRecords=<%numberOfRecords2;%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    In the custom tag java code called "DisplayTableClaimHistoryTag"
    I tried to used the following code:
    >
    InquiryContext ic = InquiryContext.getContext(session);
    >
    The problem is that in order to get session I needed HttpSession object. I don't know how to passed HttpSession "session" object
    to a custom tag. Is there a way to do this?
    >
    public class DisplayTableClaimHistoryTag extends InquiryTag
         String numberOfRecords;
         public void setNumberOfRecords(String numberOfRecords)
              this.numberOfRecords = numberOfRecords;
         public String getNumberOfRecords()
              return numberOfRecords;
         public int doStartTag()throws JspException
              InquiryContext context = (InquiryContext)pageContext.getSession().getAttribute(Constrain.CONTEXT);
              if(context==null)
                   throw new JspException(TAG_EXCEPTION+ "InquriyContext is null.");
              String hasData = (String)context.getAttribute(Constrain.CONTROL_HAS_DATA);
              if(hasData==null)
                   throw new JspException(TAG_EXCEPTION + "The hasData property can not be null.");
              boolean hd = Boolean.valueOf(hasData).booleanValue();
              Debug.println("hasData="+hd);
              Debug.println("hasDataString="+hasData);
              if(hd)
                   displayTable();
              else
                   disPlayError();
              return SKIP_BODY;
         private void displayTable() throws JspException
              String outString ="";
              Debug.println("dispalyTable() ********* dataAction="+ dataAction);
              JspWriter out = pageContext.getOut();
              * Minimum height height= 103,70
              * 21.7 per row
              * First row==103+21.5=124.5
              * Second row ==103+21.5*2=146
              * Third row ==103+21.5*3=167.5
              Double numberOfRecordsBigDouble = new Double(numberOfRecords);
              double numberOfRecordsDouble = 70 + 21.8*numberOfRecordsBigDouble.intValue();
              if(order==null || order.equals("0"))
              //     outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\""+numberOfRecordsDouble+"\"" +" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              //     outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              //     outString = "<iframe src=\"" + "http://www.google.ca"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              else
                   String orderStr = "?order=" + order;
                   outString = "<iframe src=\"" + "/inquiry/" + dataAction + orderStr + "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\""+numberOfRecordsDouble+"\"" +" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
                   //outString = "<iframe src=\"" + "/inquiry/" + dataAction + orderStr + "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\"161\" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              Debug.println("dispalyTable() ********* outString = "+ outString);
              try {
                   out.println(outString);
              } catch (IOException e) {
                   this.log.error(TAG_EXCEPTION + e.toString(), e);
                   throw new JspException(e);
    >
    Any hint would be greated appreciated.
    Yours,
    John Smith

    Ok, couple of things
    1 - ALWAYS put quotes around attributes in a custom tag. That rules out items #1 and #5 as incorrect.
    2 - You were correct using the <%= expr %> tags. <% scriptlet %> tags are not used as attributes to custom tags. That rules out #3 and #4
    #2 looks the closest:
    2.)
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>Error Message:
    claimHistoryView.jsp:190:4: The required attribute "numberOfRecords" is missing.
    <inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    Check your spelling of that attribute. It looks right here,.
    You also said that ic.getTotalNumOfRecords returns an int, while the attribute returns a String
    Try
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords="<%="" + ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/><%= "" + ic.getTotalNumOfRecords %> is the cop-out way to convert an int to a String :-)

  • Custom tag attribute case insensitive??

    We ran in to an interesting "feature" of custom tags: The attributes in the
              tags seem to be case insensitive.
              For example, if you play with the "tagext/quote" example provided with the
              WebLogic server installation, you can change the line in showcode.jsp to be
              like:
              <quote:code quoteColor="blue" COMMENTCOLOR="purple"
              defaultFont="face=Helvetica color=gray">
              and the generated java servlet code will still call the "setCommentColor()"
              method in the CodeTag class. Almost like it searches for a matching
              "attribute" in the .tld file and uses it. If you put multiple entries in
              the .tld file for different cases, it still picks the first one it finds and
              ignores the case differences.
              The J2EE/JSP spec indicates that custom tags are case sensitive, I assumed
              that is supposed to include their attributes.
              It bit us because we want to have attributes which differ by case only
              (don't ask).
              -Greg
              Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
              www.oreilly.com/catalog/entjbeans3 or www.titan-books.com
              

    I had the same problem in a design a couple of months ago and could not get around it so I switched the functionality into code and out of the tag lib.
    I take it you are trying to do something like this?
    <%
    String value="hiworld";
    %>
    <mytaglib:saysomething value="<%=value%>"/>

  • Problem with custom tag attribute types

    Hi,
    I try to figure out how to pass an attribute to a custom tag that is of a type other than "String"?
    In my case, I should pass an attribute with a type of "java.util.ResourceBundle".
    My tag looks like this:
    <tt:cs sel="ab" ce="<%= java.util.ResourceBundle.getBundle("de", Application.getApp().getLocale())%>" />
    I always get the message that the attribute ce is empty.
    Isn't it possible to have attirbutes that are of an other type than string? How could I solve this problem?
    Thanks a lot!
    Regards Patrick

    In JSP 1.2, in the Tag Library Descriptor, you can specify a tagt attribute as
    <attribute>
       <name>attr1</name>
       <required>true|false|yes|no</required>
       <rtexprvalue>true|false|yes|no</rtexprvalue>
       <type>fully-qualified_type</type>
    </attribute> Notice the XML element <type>fully-qualified_type</type>
    Not sure if you can do this in JSP 1.1

  • 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

  • Custom Tag: pass my own type in as attribute

    I thought I can pass any type as attribute into my custom tag. I tried, but failed. The exception is:
    org.apache.jasper.JasperException: Unable to convert '${myType}' to class MyTpye for attribute myAttribute: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager.
    I know I can pass the value in using PageContext attribute. However, still want to figure out how to do it through custom tag attribute.
    Here's my taglig file:
    <tag>
    <name>myTag</name>
    <tag-class>MyTagClass</tag-class>
    <body-content>empty</body-content>
    <attribute>
    <name>myAttribute</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    <type>MyType</type>
    </attribute>
    </tag>
    What am I missing here? Thanks.

    Hi
    Pls tell me how did you resolve this issue. I am also facing the same problem.
    Thanks
    Prakash

  • Custom tag attribute values..

              hi,
              I have created custom tags from my EJB using ejb2jsp tool. I tried the following,
              1 works and the other doesn't,
              a) This works.
              <mytag:foo param1="<%="test"%>" />
              b) this gives me a "ClassCastException" <% String value = "test"; %> <mytag:foo param1="<%=value%>"
              />
              ----++++++ java.lang.ClassCastException: java.lang.Object at javax.servlet.jsp.tagext.TagData.getAttributeString(TagData.java:165)
              at com.niteo.projects.intelXML.xbrl.ejb.jsp_tags._XBRLContentProvider_se tIdTagTEI.isValid(_XBRLContentProvider_setIdTagTEI.java:37)
              at weblogic.servlet.jsp.StandardTagLib.verifyAttributes(StandardTagLib.j ava:443)
              ----++++++
              I have tried all possible tricks, but this doesn't work. Is there something that
              I missed while creating the custom tag Or is it the way I am using the tag..?
              any help pls...
              thx in advance -jay
              

    It seems like you want to be able to clear the default attribute and set an empty attribute in you custom tag. One way around this would be to pass a blank character in. That would force the default to be cleared with the blank. You could take it a step further and trim the attribute value before storing it. Alternatively you could set an overriding attribute such as:
    <slasher:foo name="slasher" ignorewhatever="true" />
    protected String whatever = "some default Value";
    public void setWhatever(String whatever)
         this.whatever = whatever;
    public void setIgnorewhatever(String ignore)
         if(ignore.equals("true"))
              this.whatever = "";
    }Cliff

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

  • Is it possible to set a custom tag attribute from a TagExtraInfo?

    Hi Everyone,
    I'm developing my own tags and I need to set some optional attributes of my custom tag if the user doesn't do it.
    Is is possible to do that on the IsValid method of a TagExtraInfo class?
    The code is running without exceptions but is not setting the attribute.
    My Tag (The optionValue attribute is optional):
    <qe:select name="cars" optionBody="carName" optionValue="carID" />My TagExtraInfo class:
    public class SelectTei extends TagExtraInfo {
        private static final Logger logger = Logger.getLogger(SelectTei.class);
        @Override
        public boolean isValid(TagData tagData) {
            String optionBody = tagData.getAttributeString("optionBody");
            String optionValue = tagData.getAttributeString("optionValue");
            if (optionBody != null && optionValue==null){
                    tagData.setAttribute("optionValue",optionBody);
            //Other validations.... 
            return true;
    }

    CFGadget wrote:
    It's not obvious as to how to set a background color which is by default, black.
    Assuming you mean set the background color of a new image, just set the desired canvas color using hex or a named color ie "red", "white", ...
                    ImageNew([source, width, height, imageType, canvasColor])

  • [Custom Tags] Dynamic Variable Name // Spring MVC

    I am having a problem with a tag,
    i try to make a dynamic select tag that is reuseable, the problem is that my spring controller generates a model where i can access the list information for a select and that i have to pass this to the dynamic tag, the model could have different name, so it could be ${listitemsa} ${listitemsb} ${listitemsc} and i want to pass this list to my custom tag.
    i tried the following, but the problem is that the var is passed as a string and not the list, does anybody know how to do this?
    <tag:formfield-selectbox name="listA" path="prototypeForm.selectionA" list="${listitemsa} " />
    <tag:formfield-selectbox name="listB" path="prototypeForm.selectionB" list="${listitemsb} " />
    <tag:formfield-selectbox name="listC" path="prototypeForm.selectionC" list="${listitemsc} " />     
    <%@ tag body-content="scriptless" %>
    <%@ attribute name="name" required="true" %>
    <%@ attribute name="path" required="true" %>
    <%@ attribute name="list" required="false" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> 
    <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    <spring:bind path="${path}">
         <c:if test="${status.error}">
              <span class="error">
                   <c:forEach items="${status.errorMessages}" var="error">
                        <c:out value="${error}"/>
                   </c:forEach>
              </span><br />
         </c:if>
         <label for="<c:out value="${status.expression}"/>">${name}: </label>
         <form:select path="${path}">
              <form:option value="-1" label="--Please Select--" />
              <form:options items="${list}" />
         </form:select>
    </spring:bind>

    I've sorted it. Here's the solution for anybody experiencing the same problem.
    The problem is with switching from Java 1.2.1 to Java 1.3.0_02. Custom tags are (as of the JSP 1.1 spec) JavaBean compnents, and the Introspector appears to work differently in different Java versions.
    Consider this example:
    public void setAbc(String abc){}
    public boolean getAbc(){}Since the setter method takes a String and the finder method returns a boolean, the 1.2 Introspector takes the property type to be String, and returns null as the finder name. Java 1.3 (I haven't tested this explicitely, but this is what seems to be happening), returns null for both the setter name and the finder name (Probably a better way to do it, but breaks old code).
    We've rolled back to Java 1.2 and everything works again. It looks to me like the best way to fix the problem for 1.3 is to write custom BeanInfo classes for each JSP custom tag (Can anybody recommend a good JavaBeans book?). I don't yet know what will happen when you have multiple setter methods with different parameter types??? - something I've always found useful in custom tags.
    You don't get the problem on some JSP engines that don't use the Introspector (apparently JRun just puts the method name in the code and lets it fail at runtime if it doesn't exist, whereas apache and iPlanet check the methods exist at compile time).
    Here's where I got most of the answers from:
    http://groups.google.com/groups?hl=en&safe=off&ic=1&th=9330b85b1867cc7,3&seekm=8rnl24%24ef1%241%40nnrp1.deja.com#p
    http://groups.google.com/groups?hl=en&safe=off&ic=1&th=edd3053ac670ff5b,8&seekm=D8E32A666B62F7BD0076240185256A16.0073785185256A15%40webforums#p
    http://groups.google.com/groups?hl=en&safe=off&ic=1&th=7b5480449150ea26,3&seekm=3B2FA8C3.3F14A9F3%40switzerland.org#p

  • Query about tag extensions and custom tags

    Hello,
    Can u please clarify me where are these tag extensions and custom tags are actually used. (in which conditions)
    What are the advantages in using them...
    thanks in advance..
    Jaagy.

    You have to remember that .tag are, in a way, jsp pages, so you can use other custom tags, etc.
    We use them when we need template that are mostly html, with a little bit of logic in them that we want to reuse.
    For example, we made one for or header and footer. In header.tag, we set all of our http info, from doctype to body, including default css, title, etc if they are not supplied as parameter, and in our footer we put the /body and /html tags. Now, our typical pages look like
    <%@ taglib tagdir="/WEB-INF/tags" prefix="custom" %>
    <custom:header title="Page title" />
    ... page content
    <custom:footer />Now, if we want to change some attribute for the whole page, or to put a signature in each page, we just have to change the corresponding .tag file and the whole site is update.
    Also, .tag file can be used to display selectively page fragment.
    Take a look at Sun's tutorial for more info:
    http://java.sun.com/webservices/docs/1.3/tutorial/doc/JSPTags5.html#wp89664
    Hope this helps!
    Patrick

  • Question about custom tags

    Hi All,
    Please tell me what is differnce between javabean and custom tags.
    thank you.

    Javabean is a data object (or a data holder) whose properties can be accessed using getters, setters - ex getName() and setName()
    JSP custom tags are merely Java classes that implement special interfaces (Tag interface). Once they are developed and deployed, their actions can be called from your HTML using XML syntax. Refer the article http://java.sun.com/developer/technicalArticles/xml/WebAppDev3/
    Cheers,
    Janesh

  • Class as an attribute name in JSP tag file

    I just ran into an issue where I was writing a custom tag to generate a specific set of HTML elements, and wanted to be able to use CSS the same way I had before refactoring it into a tag. So, I included 'class' as an attribute in the custom tag file and deployed.
    On Glassfish v3, this generated a bunch of JasperExceptions in the Javac compilation, complaining about <identifier> expected and reaching the end of file while parsing. I tracked it down, of course, to the use of 'class' as an attribute name, which was reduced to a servlet class defining:
    public String getClass() {
       return this.class;
    public void setClass(String class) {
       this.class = class;
    }I'm curious -- which part of the process messed up here? Is "class" a valid identifier under the Java EE spec, and the translation should have used something like setClass_(String class_)? Or is it invalid, and Netbeans didn't know to mark it as an error before it tried to deploy? (And, of course, that I missed that in the spec, making it my fault.) I couldn't find anything specifically saying that reserved words couldn't be used as JSTL identifiers, so my gut is that the parser messed up. Also, I found a bug report about it for an alternate web container, but no mention of it in the bug trackers for Glassfish, Tomcat or Jasper.
    Where's the blame?

    stdunbar wrote:
    I think that Netbeans messed up. getClass() is, of course, defined on Object and class is a Java keyword.What's to stop the compiler from recognizing that "class" would be a problem and mapping it to an alternate name behind the scenes?
    This is the only documentation I turned up. Maybe this says it's invalid:
    Java EE SpecThe unique name of the attribute being declared. A translation error results if more than one attribute directive appears in the same translation unit with the same name.A translation error results if the value of a name attribute of an attribute directive is equal to the value of the dynamic-attributes attribute of a tag directive or the value of a name-given attribute of a variable directive.

  • 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

  • My phone wont go past apple logo!!

    I had my phone on the couch and i went away and came back, and realized that it was turned off, i tried to turn it back on but it wouldnt go past the apple logo, i went to AT&T and the tech said it had water damage, and the water sensor was pink, but

  • I need help... I know it's gonna be easy for you guys!!!

    Hello, I'm from Chile.... I have a table, and a i need to count the fields(columns) of that table... ¿how can i do it with a query or procedure in PL/SQL? I'll appreciate if you help me Thanks!!

  • Error Entry into Tables?

    I am trying to capture errors that occur on pages throughout the application, and enter the data into the table below. The first 3 columns constitute the primary key. I need to grab the errors that occur and the necessary information, and ensure that

  • Update to Fax Number Required in Central Address Management

    We are on 4.6C, also using SRM.  A fax number is incorrect for a specific address in CAM, and needs to be updated.  How do I make this change in CAM?

  • PO Invoice price difference handling - accounting issues

    Hi, I am working for a distribution company that is selling right away the goods it bought. Therefore we first receive the goods before creating a PO and then receive the invoices from our suppliers later on. Very often, there are differences between