Hello,
since Trinidad 1.2.12 I have a Problem with the <tr:validate... Tags.

Environment: Tomcat 6.0.18; mojarra-1.2_13-b01-FCS; Facelets 1.1.14 ;
Trinidad 1.2.12;
Browser: IE 8 or Firefox 3.5.3

First I have to say that I use the pattern and length from a properties file
in my page.
If I do not allow a regexp in my input field then I get the error all the
time. It doesn't matter if the input matches the regexp the error occurs
always.
The same problem if I use the tr:validateLength and don't allow Strings with
a length over 10.


My code for example:

validator.properties
namePattern=^[^/%&<>'\"\\\\]+[^ ]$

inputLength.properties
name=10

part of testpage.jspx
<f:loadBundle basename="de.config.InputLength" var="inputLength" />
<f:loadBundle basename="de.validator.ValidatorMessages" var="validator" />
<tr:inputText id="receiverName" value="#{MessageBean.name}">
        <tr:validateRegExp pattern="#{validator.namePattern}"
messageDetailNoMatch="#{validator.errorNotAllowed}"/>
        <tr:validateLength maximum="#{inputLength.name}"
messageDetailMaximum="#{validator.errorMaxLength}" />
</tr:inputText>


With the lenght validator I get the error "Darf maximal 0 Zeichen haben."
but the pattern for the message is "Darf maximal {2} Zeichen haben.". So
obviously the validator doesn't get the value for inputLength.name right.

If I use the value in the code instead of the properties file it works.

Using the value in the code I can't disallow ". I always get an error if "
is in the pattern. No matter how I escape it. I tried \" \\" \\\" and \\\\".
How can I put " into the regexp?
javax.servlet.ServletException: Error Parsing / testpage.jspx: Error
Traced[line: 58] Element type "tr:validateRegExp" must be followed by either
attribute specifications, ">" or "/>".


Can anybody help? I would love to use the pattern in the properties file
again because ist pretty inconvenient to define it in every page.

Thanks, Tobias

Reply via email to