You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Updated) (JIRA)" <ji...@apache.org> on 2011/12/09 10:44:40 UTC

[jira] [Updated] (WW-3066) RegexFieldValidator not working correctly on IBM JVM - xml validation files

     [ https://issues.apache.org/jira/browse/WW-3066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-3066:
------------------------------

    Fix Version/s: Future

Seems to be solved already, could you check against the latest version ?
                
> RegexFieldValidator not working correctly on IBM JVM - xml validation files
> ---------------------------------------------------------------------------
>
>                 Key: WW-3066
>                 URL: https://issues.apache.org/jira/browse/WW-3066
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.1.6
>         Environment: IBM WAS 7.0
>            Reporter: Tomasz Filak
>             Fix For: Future
>
>
> We use -validation.xml files in our struts2 web application. Validation worked fine on Tomcat but since we migrated to Websphere 7.0, we have noticed strange behaviour of the XWork Validator framework. After some debugging we found, that the reason was RegexFieldValidator.getTextValue(Element valueEle) method.
> On IBM JVM, XML expressions containing XML entities (such as &amp; or &gt; ) are parsed as separate nodes, so following configuration:
> <field-validator type="fieldexpression">
> 	<param name="expression">( (placeId != null &amp;&amp; placeId &gt; 0))</param>
> 	<message>String required</message>
> </field-validator>
> resulted in following Nodes being bassed to RegexFieldValidator.getTextValue() method:
> ( (placeId != null 
> &
> &
>  placeId 
> >
>  0))
> After merging those nodes, getTextValue returned this String: "( (placeId != null & & placeId >  0))."
> Additional space were added added between nodes, which broke the whole expression. The same behaviour was noticed when using CDATA tag.
> Our quick-fix was to override the RegexFieldValidator.getTextValue() to delegate to DomUtils.getTextValue() method.
> Best regards.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira