Maybe this question is better addressed on the *new* shale user list

<user AT shale.apache.org>

On 7/7/06, Alex Yakushev <[EMAIL PROTECTED]> wrote:

Hello everybody!
I am a new in Shale Validation Framework. Actually I got an error then form
submitted.

2006-07-07 13:52:21,401 [http-80-Processor23] WARN
org.apache.commons.validator
.ValidatorResources - Form 'org.apache.shale.validator.minFloatValue' not
found
for locale 'en_US'
2006-07-07 13:52:21,401 [http-80-Processor23] ERROR
StandardWrapper[/RPTCService
sManagement:Faces Servlet] - Servlet.service() for servlet Faces Servlet
threw e
xception
java.lang.NullPointerException
        at
org.apache.shale.validator.CommonsValidator.getArgs(CommonsValidator.
java:621)
        at
org.apache.shale.validator.CommonsValidator.getMethodParamNames(Commo
nsValidator.java:585)
        at
org.apache.shale.validator.CommonsValidator.loadMethodParamValues(Com
monsValidator.java:715)
        at
org.apache.shale.validator.CommonsValidator.validate(CommonsValidator
.java:798)
        at
javax.faces.component._ComponentUtils.callValidators(_ComponentUtils.
java:157)
        at javax.faces.component.UIInput.validateValue(UIInput.java:312)
        at javax.faces.component.UIInput.validate(UIInput.java:353)
        at javax.faces.component.UIInput.processValidators(UIInput.java:183)
        at
javax.faces.component.UIComponentBase.processValidators(UIComponentBa
se.java:624)
        at
javax.faces.component.UIComponentBase.processValidators(UIComponentBa?

That is wrong with my code?
Seems, information from custom-rules.xml file loaded properly, but it is
looks like minFloatValue method can not findound.

INFO: Loading validation rules file from /WEB-INF/custom-rules.xml
2006-07-07 13:52:16,714 [http-80-Processor24] WARN
org.apache.myfaces.renderkit
.html.util.ReducedHTMLParser - Invalid tag found: unexpected input while
looking

1.      /WEB-INF/web.xml
    <!-- Shale Validator Configuration Resources -->
    <context-param>
      <param-name>org.apache.shale.validator.VALIDATOR_RULES</param-name>
      <param-value>
        /org/apache/shale/validator/validator-rules.xml,
        /WEB-INF/custom-rules.xml
      </param-value>
    </context-param>

2. /WEB-INF/custom-rules.xml

<!DOCTYPE form-validation PUBLIC
  "-//Apache Software Foundation//DTD Commons Validator Rules Configuration
1.2.0//EN"
  "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd";>
<form-validation>
  <global>
    <validator name="minFloatValue"
      classname="test.ValidationUtil"
      method="isMinFloatValue"
      methodParams="java.lang.Object"
      msg="errors.minFloatValue">
    </validator>
  </global>
</form-validation>

3.      /WEB-INF/faces-config.xml
  <application>
        <message-bundle>mot.resource.shale_messages</message-bundle>
    <locale-config>
      <default-locale>en</default-locale>
      <supported-locale>en</supported-locale>
    </locale-config>
  </application>

4. ValidationUtil Class.
package test.jobmaintenance;

public class ValidationUtil
        implements java.io.Serializable
{
        public static boolean isMinFloatValue(Object value1)
        {
System.out.println("++++++++++++++++++ RECEIVED VALUE1 "+value1);
       return false;
    }
}

5. JSP Page.
                        <t:message for="adminFee" styleClass="ErrorMessage"
rendered="#{mtJobEditor.isEditableAdminFee}"/>
                        <t:inputText id="adminFee" 
value="#{mtJobEditor.job.tmpAdminFee}"
                          rendered="#{mtJobEditor.isEditableAdminFee}"
                          maxlength="10" size="10"
                          tabindex="-1"
                        >
                          <s:commonsValidator
                                type="minFloatValue"
                                server="true"
                client="false"
                          />
                        </t:inputText>
                        <t:outputText 
rendered="#{!mtJobEditor.isEditableAdminFee}"
                           value="#{mtJobEditor.job.tmpAdminFee}"
                        />

I will be appreciating for any feed back.
Alex.


--
View this message in context: 
http://www.nabble.com/Shale-Validation-Framework-Issue.-tf1907955.html#a5222352
Sent from the MyFaces - Users forum at Nabble.com.




--
Matthias Wessendorf

futher stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Reply via email to