Thanks!!
I will submit a bug ticket tomorrow.
Looking at the validator-rules.xml it looks like a double validator has been completely omitted.

mas

Gary VanMatre wrote:
From: Mark Shifman <[EMAIL PROTECTED]> Thanks Gary: I am now getting a much more insidious exception thrown. I using the following:
<h:inputText id="s_id"  size="16" value="#{su_menu.s_id}">
   <s:commonsValidator type="required" server="true" client="true" 
arg="#{msgs.validate_s_id}"/>
   <s:commonsValidator type="float" server="true" client="true"  
arg="#{msgs.validate_s_id}" />
</h:inputText>

java.lang.NullPointerException
at org.apache.shale.validator.CommonsValidator.validate(CommonsValidator.java:525)


This is a bug in the validator-rules.xml.  The formal parameter of the isDouble 
method
defines the parameter type as a double but it's actually a String.
The validator entry should be:

      <validator name="float"
            classname="org.apache.commons.validator.GenericValidator"
               method="isDouble"
         methodParams="java.lang.String"
              depends=""
                  msg="errors.float"
       jsFunctionName="FloatValidations">

Please submit this as a bugzilla ticket but I have a workaround.

The default validation-rules.xml is packaged in with the shale-core.jar but you can override this by a parameter in the web.xml.

 <context-param>
    <param-name>org.apache.shale.validator.VALIDATOR_RULES</param-name>
    <param-value>/WEB-INF/validator-rules.xml</param-value>
  </context-param>

Copy down the validator-rules.xml into your WEB-INF and change the methodParams
to match the fragment above.

http://svn.apache.org/viewcvs.cgi/struts/shale/trunk/core-library/src/conf/validator-rules.xml?view=markup


Gary

--
Mark Shifman MD. Ph.D. Yale Center for Medical Informatics Phone (203)737-5219 [EMAIL PROTECTED]

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to