f:validator tag validatorId attribute doesn't resolve EL Expressions?

I have a set of custom validators that I've written to validate certain data types used in our application. I have tested all of them and verified that they all work. Now I want to display a data table showing a list of data input fields, each bound to an object of a different type. During the iteration the 'item' has a method called "getValidatorIdentifier()" which returns a String that is the ID of the validator registered in my faces_config.xml file. Using the following code, I want to set the validatorId dynamically for each inputText field in my data table.
<h:dataTable var="item" ..... >
<h:inputText id="itemValue"
required="#{item.required}"
value="#{item.relatedAsset.asset}">
<f:validator validatorId="#{item.validatorIdentifier}" /> <!-- PROBLEM?-->
</h:inputText>
</h:dataTable>
Now, when I hard-code the validatorId attribute to the registered validator ID, it works fine. When I try to use the EL expression, as in the above code, I get the following when I access the page:
java.lang.NullPointerException: Argument Error: One or more parameters are null.
     com.sun.faces.application.ApplicationImpl.createValidator(ApplicationImpl.java:712)
     javax.faces.webapp.ValidatorTag.createValidator(ValidatorTag.java:146)
     javax.faces.webapp.ValidatorTag.doStartTag(ValidatorTag.java:109)
I looked in the O'Reilly JavaServer Faces book and it states that the validatorId attribute should accept an EL expression type of 'any', so I am assuming that the expression #{item.validatorIdentifier} should work.
Am I making a mistake here, or is there a bug I don't know about in the f:validator tag?
Thanks for your help.

A little more information on this issue.
When I attempt to resolve the validatorId from the 'item' var (the variable in the data table iteration) I get the problem described in my first posting. Now if I create an outputText element simply to echo the value of item.validatorIdentifier, it displays the correct value that I would expect.
<f:validator validatorId="#{item.validatorIdentifier}" /> <!-- This fails with the error already described-->
<h:outputText value="#{item.validatorIdentifier}"/> <!-- this works just fine -->
Now, just to see if it was the EL, I modified the validator tag to use an EL expression bound to a getValidatorId() method in a managed bean class. In other words, when I'm NOT trying to resolve the validatorId from the iteration variable, an EL expression works.
<f:validator validatorId="#{myManagedBean.validatorId}" /> <!-- This works just fine-->
But, this is not a solution, since each element in my dataTable iteration needs to report to me what its validator ID should be.

Similar Messages

  • More on validator tag

    Hi,
    I've written some custom validators to use custom messages and to implement simple cross-validation (such as, for example, a text field required only if a checkbox is checked).
    I'm trying to use the validator tag from jsf core library. I need to pass some parameter to my validators: I've tryed with an attribute tag nested into the validator tag with no luck. Same using a parameter tag.
    Do I must write a custom tag to pass parameters to the validator or can I use the core validator tag in some way ?
    Thank you
    Andrea

    If you need to pass attributes you need to use a custom validator tag.
    -Jayashri

  • Minor IDE bug: property inspector for f:validator tags

    Hi JDev team
    Very minor IDE bug in the JDev 11g tech preview release.
    If you open a web page with a f:validator tag, select the tag, look in the property inspector. In the selectors-groups (or categories) on the left hand side of the property inspector, the option "other" is showing, but there is also a selectable blank space above this that should be appropriate named.
    Regards,
    CM.

    Hi Liza, thanks for logging the bug.
    Regards the Property Inspector, well you asked...... ;)
    I can see why you've gone for the new look and feel, it does look better.
    One caveat though. On my 24 inch monitor, with the property inspector by JDev's pref on bottom of the screen, the fields are stretched all the way across the screen pointlessly wasting screen real-estate .... always a problem in JDev. So I move the property palette back to its more traditional spot on the right hand side of the screen.
    As a side window, it doesn't currently "squash" properly. I've uploaded an image for you to see what I mean. Poplists don't seem to shrink properly in some cases. And in some cases the same with fields. It also appears labels take preference in size to fields, to the detriment fields disappear.
    http://members.iinet.net.au/~chriscmuir/SquashedPI.png
    Anyway, just my $0.02 worth.
    Regards,
    CM.

  • Error - tag.getAsString : attribute 'title' not found in context ---- Help

    hi,
    I have included a jsp page in tiles definition xml. if i try to access an attribute defined in the tiles definition using tiles:getAsString method it is throwing the following exception
    Error - tag.getAsString : attribute 'title' not found in context
    can anyone help me how to get rid of this problem?
    Thanks in advance.

    yes ,
    reference already enter in web.xml
    <resource-ref>
              <description>
              </description>
              <res-ref-name>jdbc/iconnectDS</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              <res-sharing-scope>Shareable</res-sharing-scope>
         </resource-ref>
    still same problem
    pullareddy

  • p tags with attributes not removed from JTextPane

    We are using HTMLEditorKit with JtextPane to create a HTML Document Editor, for our project. [JDK 1.3.1.]
    When we have a simple <p> tag for paragraph in HTML and we start deleting things from end of the document, it works fine. But when we have a <P> tag with attributes like <p align='CENTER'> the delete key deletes the characters but the cursor remains in the line below and doesnot move up as the characters of above para get deleted. The HTML also retains the <p align='CENTER'> tag, which should have been removed. It seems its not able to identify <p> tags with attributes as Html para tags, and so not deleting it.
    How do we solve this without migrating to jdk1.4 ? Please help.

    Usually attributes such as 'align=center' are deleted along with a tag, regardless of whether it is a p tag or another one. But you would have to carefully test what exactly gets deleted because attributes are not only stored with paragraphs. They can exist for single characters and as well come from a style sheet.
    The best is to generate a dump of your document before and after deletion.
    You can use something like the below code (it is not optimized at all and thus could be implemented better but it works) to produce a dump
      public void listElements(Element elem, int indent) {
        int i;
        String is = getIndent(indent);
        String elemName = elem.getName();
        Document elemDoc = elem.getDocument();
        String cont = "";
        String theText = "";
        System.out.println(is + "--start-----");
        System.out.println(is + "Element Name:" + elemName);
        if(elemName.equals(new String("content"))) {
          try {
            theText = elemDoc.getText(
                    elem.getStartOffset(),
                    elem.getEndOffset() - elem.getStartOffset());
            System.out.println(is + "Content: " + theText);
            if(theText.indexOf("\r") > -1) {
              System.out.println(is + " plus \\r");
            if(theText.indexOf("\n") > -1) {
              System.out.println(is + " plus \\n");
          catch (Exception e) {
        listAttributes(elem, indent);
        if(!elem.isLeaf()) {
          for(i=0;i<elem.getElementCount();i++) {
            listElements(elem.getElement(i),indent+2);
        System.out.println(is + "---end----");
      public void listAttributes(Element elem, int indent) {
        Object key;
        String attr;
        String attrName;
        int pos;
        String is = getIndent(indent);
        AttributeSet as = elem.getAttributes();
        Enumeration an = as.getAttributeNames();
        try {
          while(an.hasMoreElements()) {
            key = an.nextElement();
            attrName = key.toString();
            attr = as.getAttribute(key).toString();
            System.out.println(is + "Attribute Name: " +
                      attrName + " Attribute Content: " + attr);
            if(attr.indexOf("\r") > -1) {
              System.out.println(is + " plus \\r");
            if(attr.indexOf("\n") > -1) {
              System.out.println(is + " plus \\n");
        catch (Exception e) {
          e.printStackTrace();
      }Hope that helps
    Ulrich

  • Get all tags and attributes from schema

    Mapping question
    I have a mapping requirement where the customer needs all the tags and attributes from the schema whether it has a value or not. The schema has almost 1500 tags and each of them has a attribute. We are mapping only about 50 of them, so the rest of them has to be blank. Actually about 700 of the attributes has fixed values like CHAR. Normally I would create a second mapping and use exists otherwise map a empty tag, but in this case the number of tags is high. Is there a easy way to create all the blank tags during runtime similar to using generate instance in test mode or generate sample file in xmlspy.
    The scenario is IDOC to SOAP with BPM customer is using a custom schema
    Thanks in advance
    Asif

    Any hint or suggestion with the use of java/xslt/abap mapping or any other way to avoid mapping each of these tags manually will be appreciated.
    thanks
    Asif

  • Validation for 2 attributes in a single expression

    Hi All,
    I have a scenario such that I need to make 2 attributes as mandatory when I chose a particular
    Category node.
    Now I am able to write, execute validation for one attribute but when I write for 2 attributes, only the first
    attribute is being considered. Even if the second attribtue is not present, it says there are no errors.
    Regards,
    Pramod

    Hi Pramod,
    I have tried this thing at my side and its working fine.
    Please check the steps below:
    1. Create new validation and dont write any thing in the expression.
    2. Add a branch to this validation and select the node which you want to validate.
    3. Inside the branch expression just write IS_NOT_NULL(Attribute1) AND IS_NOT_NULL(Attribute2)
    select Attribute1 and Attribute2 from the Attributes list.
    4. Run the Validation.
    Regards,
    Jitesh Talreja

  • MultiRowEdt-JBO-35000: Cant resolve spel expression for attribute {0}in{1}

    Hi All,
    i'm in the process of completing the mutli row edit tutorial that I downloaded from this site. I'm using 10.1.2, adf bc and jsp's.
    I've competed the tutorial and am getting an error JBO-35000: Cant resolve spel expression for attribute {0} in {1} .
    I've checked that my attribute names are the same as the VO and have created a BeanInfo class to handle the mapping of these attributes. All appears as it should, so not sure where to go from here.
    Any ideas would be gratefully received.
    Thanks in advance,
    Newbw

    hello,
    I'm facing the same problem in implementing mutli row edit tutorial.
    I'm using JDeveloper 9051.
    Can u please tell me how did u solve ur problem as i didnt understand what u've posted on forum "spelt my VO wrong".
    Please reply. waiting
    Thanks in advance
    Mina

  • Use jsp tag output as another tag's attribute value

    I don't know anyone has ever tried this, one tag's attribute value needs to be dynamically set using another tag's output. Something like
    <layout:grid cols="<layout:write name="element" property="value"/>'' space='false'>
    </layout:grid>
    I want the cols attribute of grid tag to be the output of <layout:write name="element" property="value"/>
    The way I wrote is of course not working.
    But I know PHP can do things similar to this, JSP should be able to achieve something like this too.
    If anyone knows how to do this or using any alternative way to do this, please let me know.
    Shane

    something like this...
              OuterTag qParent = null;
              try {
                        Tag myParent = getParent();
                        while (myParent != null ) {
                          // loop up through tags until you find the one you want
                             if (myParent instanceof OuterTag) {
                                  qParent = (OuterTag) myParent;
                                  data = qParent.getSomeData();
                             } else {
                                  myParent = myParent.getParent();
                   }

  • ITunes has face tags that it doesn't exist in iPhoto

    I was trying to sync photos to my iPhone 5s via iTunes. But I found out there is a face tag that it doesn't exist in iPhoto. Is there a way to delete the face in the iTunes?

    This happened to me also, a few days ago... I went to look at pics that were sent from just one person, all the other photos that people texted are there during same time period.  It is only this one contacts several photos that disappeared...   There is an arrow when I click on it it goes to a blank page?!?   Have you received any feedback or answers??  Did your photos  that are missing come from only one person or multiple?  If you have any information that might help let me know!!!  I really want them back!!  Thanks much!

  • No Valid Tag Requested

    Hi all,
    I created a TagQuery in HistoryEvent mode and sent a tag name, but when I run the TagQuery, sometimes I got return of the data and other times no, I get an error:
    com.sap.Illuminator.logging.LHException: No valid tags requested
    Does anyone know what might be happening?
    Regards,
    Danilo Santos

    Hello Mike,
    We are using the following versions:
    SAP MII 12.0.4 Build(120)
    SAP NetWeaver 2004 / 7.0
    UDS 2.5.04
    The historian is PI - OSISoft
    see the below complete error in log netweaver
    Full Message Text
    *** MISSING RESOURCE: Unable to localize com.sap.xmii.Illuminator.logging.LHException: com.sap.xmii.Illuminator.logging.LHException: com.sap.xmii.Illuminator.logging.LHException: No valid tags requested
    You don't think the PI server or SAP MII server maybe overloaded?
    Thanks,
    Danilo Santos

  • Attribute value does not accepitng expression ???

    ]I am using Tomcat 5.0.28 and JSTL 1.0.6. I put the files standard.jar and jstl.ar within my web-app WEB-INF/lib folder. I made no changes in web.xml. Then I ran the following program as test.jsp
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <body>
    <c:set var="hello" value="Hello World!"/>
    <c:out value="${hello}"/>
    </html>
    </body>
    I'm getting this error message <br>
    "According to TLD or attribute directive in tag file, attribute value does not accept any expression"

    With Tomcat5, you should be using JSTL1.1.
    The JSTL1.0 tags didn't let you use runtime expressions like <%= expr %> with your tags. Instead you had to use ${expr}.
    ${expr} is a runtime expression in JSP2.0, where it wasn't before.
    JSTL1.1 provides a new tld with the correct settings.
    You should be using JSTL1.1 and the uri:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    See full spiel on JSTL vs Tomcat versions in this thread:
    http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0

  • Airport extreme doesn't recognize airport express remotes

    Airport utility doesn't recognize airport express remotes in my network even though they appear to be working. Any ideas how to fix this?

    You don't need to download drivers to the Airport Extreme Base Station.
    However, you may have to download and install a printer driver on your Mac - if Epson's web site has a newer version than the one built into OS X (which is version 3.09).
    You could also try using the alternate "Stylus Photo R340 - Gutenprint" driver built into MacOS 10.5.

  • Scriplet value in custom tag attribute doesn't compile

              Using a custom tag (a BodyTag extention) in a JSP. When WebLogic 6.0 tried to compile
              it I get the following error. It compiles fine in JBuilder and runs fine in resin
              servlet server.
              Here the source line from the JSP (I even put the messy spaces in the scriplet
              since that is how WebLogic examples do it):
              <tags:SystemSearch locationName="<%= locationName %>"     customerName="<%= customerName
              %>" systemModelNumber="<%= systemModelNumber %>"     systemName="<%= systemName %>"
              locationID="<%= locationID %>" >
              Here's the line of the compile error from the WebLogic generated servlet:
              tagsSystemSearch0.setLocationID weblogic.utils.StringUtils.valueOf("<%= locationID
              //[ /SystemBrowse.jsp; Line: 66]
              Here's the related error message:
              D:\java\bea\wlserver6.0\config\darcon\applications\.wl_temp_do_not_delete\WEB-INF\_tmp_war_dev1_dev1_ROOT\jsp_servlet\_systembrowse.java:202:
              unclosed string literal
              probably occurred due to an error in /SystemBrowse.jsp line 66:
              

    This is my tag code:
    public class ErrorTag extends SimpleTagSupport {
         private static final long serialVersionUID = 1L;
         String val = null;
         private static final String DIV = "<div class=\"error\">ERROR</div>";
         private static final String INSERT_HERE = "ERROR";
         public void doTag() throws JspException {
              try{
                   PageContext pageContext = (PageContext) getJspContext();
                  JspWriter out = pageContext.getOut();
                   if(val!=null){
                        String outputDiv = DIV.replace(INSERT_HERE, val);
                        out.println(outputDiv);
                        System.out.println("out.println -> ["+outputDiv+"]");
              }catch (Exception e) {
                   System.out.println("doStartTag -> ["+e.getMessage()+"]");
         public void setValue(Object value){
              System.out.println("setValue -> ["+value+"]");
              if(value!=null && value instanceof String){
                   String t = (String)value;
                   if(t.trim().length()>3){
                        val = t;
         public Object getValue(){
              return val;
    }I don't know waht to do. It doesn't want to eval EL expr.
    It produces output:
    *setValue -> [${errors.name}]*
    *out.println -> [<div class="error">${errors.name}</div>]*
    Edited by: Holod on 21.06.2009 15:12

  • CHTMLB dexcription tags and attributes

    Hi everybody,
    I am new in CRM WEb UI.
    Do youk now where I can find description of the tags/attributes and some explanations /examples ?
    Thanks in advance
    In SE80 in the tag libraries I found all the tags from CHTMLB byut when I clik F1 on the tag or the attributes, I receive nothing .. is that normal ?
    Thanks for your help,
    Marie

    .oO(gaurav_ch)
    > @Michael Fesser - If IE does not support XHTML, this
    means that it is
    >rendering it as HTML inspite of the XHTML DOCTYPE used in
    making pages? OMG!!!
    >I really hate Microsoft for this. Thanks for telling me
    this. I never knew that.
    Exactly. IE accepts XHTML only if the server delivers it as
    text/html.
    But then it's not really XHTML anymore.
    Real XHTML should be delivered as application/xhtml+xml,
    which would let
    modern browsers like Opera and FF use their XML parsers
    instead of the
    old and bloated tagsoup parsers, but until now IE doesn't
    support this.
    Not sure about the coming IE 8, though.
    >Still my question is unanswered - do I really need to
    learn each and every
    >attribute of an xhtml element or each and every tag that
    xhtml throws at me,
    >from the point of interview or is it sufficient to know
    those attributes and
    >elements which make me make accessible websites and
    validated markup?
    You should know at least most of the elements and attributes,
    so that
    you can use them where appropriate. Same for CSS and its
    properties. Of
    course you can't (and don't have to) remember them all.
    That's where a
    quick reference guide or a "cheat sheet" comes in handy.
    In my Opera browser for example I have these pages as sidebar
    panels for
    a quick lookup (should also work in FF):
    http://people.opera.com/rijk/panels/html4.01-online/elem.html
    http://people.opera.com/rijk/panels/css2.1-online/prop-visual.html
    Here are some more panels with previews:
    http://people.opera.com/rijk/panels/
    You also might find some of these cheat sheets quite useful:
    http://www.addedbytes.com/cheat-sheets/
    Micha

Maybe you are looking for