Client Side Javascript Validation not Working in Struts 1.x version

hi,
I'm following the steps provioded in the below link for Javascript Client side validation but still it is not working.I'm struggling to get this work.
[http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/|http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/]
"The framework automatically generates the browser specific JavaScript and validate the data only at the client side."From the above statement i undertstand that framework itself generates the javascript function for validating the field mentioned in validations.xml file so that we dont have to explicitly write a javascript function for
validating the fields
(or)
Do we need to call an explicit function
Please need help on this.
I have followed all the steps mentioned on the above link but Client Side Javascript Validation not Working in Struts 1.x version....
Thanks and Regards,
Deepak

Hi,
Please find my steps below....still getting an error.
2> which version of commons-validation.jar needs to be downloaded ...Link please
    downloaded the latest commons-validation.jar and placed in lib.refreshed the project,and did a build.
    3> which DTD name to be specified in "validator-rules.xml" which is in accordance to commons-validator.jar file.
validator-rules.xml ::
<!DOCTYPE form-validation PUBLIC
          "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
          "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">validation.xml:
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
i did as u said and im gettiong the below errorNov 5, 2009 4:33:08 PM org.apache.struts.validator.ValidatorPlugIn initResources
SEVERE: Invalid byte 2 of 2-byte UTF-8 sequence.
org.apache.commons.digester.xmlrules.XmlLoadException: Invalid byte 2 of 2-byte UTF-8 sequence.
     at org.apache.commons.digester.xmlrules.FromXmlRuleSet.addRuleInstances(FromXmlRuleSet.java:139)
     at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1610)
     at org.apache.commons.digester.xmlrules.DigesterLoader.createDigester(DigesterLoader.java:89)
     at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(ValidatorResourcesInitializer.java:122)
     at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:238)
     at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:181)
     at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1036)
     at org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
     at javax.servlet.GenericServlet.init(GenericServlet.java:212)
     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
     at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
     at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
     at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
     at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
     at org.apache.catalina.core.StandardService.start(StandardService.java:448)
     at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Need help forum members.....
Please reply to my question 1  which has been asked before as belowDo i need to write explicit javascript function for validation in Struts (or) struts generates the javascript function by itself.??? Please explain with an example....
Edited by: Deepak_A_L on Nov 5, 2009 4:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Javascript codes not working as they should in version 7

    I have a website that is working fine with version 3.6.9, now it is not working as it should be with version 7. My files containing javascript codes, the links in the codes are broken when am registering some controls using the <%@ Register .... /> tag.
    for example:
    i have the following code:
    <%@ Register Src="~/Controls/TempMenu.ascx" TagName="TempMenu" TagPrefix="uc1" %>
    now, whenever I click on any button in the page, instead of redirecting me to an existing page within the same folder, it will go to the "controls" folder and search for the page there...
    Please help.

    A good place to ask advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.<br />
    The helpers at that forum are more knowledgeable about web development issues.<br />
    You need to register at the mozillaZine forum site in order to post at that forum.<br />
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Client Side Email Validation

    I want to give a client side email validation in a insert screen.

    This sounds like a generic ADF question that is not related to JHeadstart. Can you please ask this question at the JDeveloper forum at http://otn.oracle.com/discussionforums/jdev.html ?
    Thanks,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Javascript is not working in JSP

    Hi everybody,
    My javascript is not working in JSP.I m not able to fix this problem.Please tell where the problem in code.
    thx in advance.
    <%@page import="javax.servlet.http.*" %>
    <%@page import="java.sql.*" %>
    <html>
    <head>
    <script type="text/javascript" >
    funtion checkentries()
    if(document.LForm.uname.value==null || document.LForm.upassword.value==null)
    alert("Please fill all entries")
    else
    document.LForm.submit()
    </script>
    </head>
    <body>
    <table width=100% height=100% valign="center" align="center" border=0>
    <tr height=10% ><td>
    <%@ include file="Header.jsp" %>
    <hr>
    </td></tr>
    <tr height=1% width=100%>
    <td align=right>Register
    <hr>
    </td>
    </tr>
    <tr height=77% width=100% ><td>
    <table>
    <tr><td width=65%>
    </td>
    <td bgcolor="black" width="1" ></td>
    <td align="right" valign="top" >
    <form method="POST" action="/EIS/Home.do" name="LForm">
    User Name: <input type="text" align=right name="uname"><br>
    Password: &nbsp&nbsp&nbsp<input type="password" name="upassword"><br>
    <input type="submit" name="submit" value="Submit" onclick="checkentries()">
    </td>
    </tr>
    </table>
    </td></tr>
    <tr height=10% ><td>
    <hr>
    <%@ include file="Footer.jsp" %>
    </td></tr>
    </table>
    </body>
    </html>

    in this part:
    if(document.LForm.uname.value==null || document.LForm.upassword.value==null)should be:
    if(document.LForm.uname.value=="" || document.LForm.upassword.value=="")or
    if(document.LForm.uname.value.length==0 || document.LForm.upassword.value.length==0)

  • My Newly bought Blackberry Classic left side speaker is not working.... Help needed...!!!!!

    Dear All,
    Please kindly help me on this, I am from Pakistan and I got my Blackberry Classic delieved to me from USA my cousin bought it from online blackberry store and brought it by hand. Just now i have noticed that my blackberry classic left side speaker is not working only ringing sound music sound and loudspeaker sounds are coming from the right side of the speaker.
    Has anyone faced this problem with his new classic and what should i do?
    Please help or guide me
    Solved!
    Go to Solution.

    Knowing this that classic comes up with only one speaker did broke my heart  But to be honest the sound is excellent even at high volume the sound does not distort. its a genuien stereo speaker

  • Using osx javascript is not working in firefox, ebay

    I am using osx mac, javascript is not working, even though it is enabled in Firefox preferences.
    == URL of affected sites ==
    http://ebay

    Problem still exists in Firefox 5.0 and OSX 10.6.8
    It was a fresh install of Firefox 5.0 so no extensions. And Javascript IS enabled in preferences.
    Sites work fine in Safari.

  • Server side mailrules are not working!

    Hi,
    on my Lion Server the server side mailrules are not working.
    I created about 4 different rules via the webmail interface but none of them are applied to incoming mails :-/
    They were working back in the days I used 10.5 and 10.6 Server (this was not upgraded!).
    Are server side mailrules are working for you?
    Any assistance would be appreciated.
    Regards,
    Eldrik

    Nevermind... got it sorted out..
    My rules are based on the senders email address and switching from "is equal" to "contains" (sorry only got the translation from German) did the trick!
    Greetz
    Eldrik

  • Why does my printer HP 3080 not work with Mac OS X VERSION 10.7.5

    Why does my printer HP 3080 not work with Mac OS X VERSION 10.7.5. Am I missing a driver? If so where do I go to download it? thanks

    What's the full model number and name of the printer?  I can't seem to find any HP printer with the numbers 3080 in the model number.
    How are you connecting the printer to the Mac?
    I am a printer tech for HP.

  • Export vCard is not working on Chrome; on Chrome Version 40.0.2214.93 m; function works on Mozilaa and IE.

    Export vCard is not working on Chrome; on Chrome Version 40.0.2214.93 m; function works on Mozilaa and IE; is anyone else seeing this same issue?

    Update; my OS is Windows 7 Pro 64-bit v1.08.00.AF B09 SP1.   Same issue reported (by 7 others) at => https://discussions.apple.com/thread/6779059

  • Googlemaps will not work since I downloaded latest version of Firefox. Any suggestions? I've followed all of the troubleshooting suggestions at Googlemaps already and no luck. Thanks.

    Googlemaps will not work since I downloaded latest version of Firefox. Any suggestions? I've followed all of the troubleshooting suggestions at Googlemaps already and no luck. Thanks.
    == URL of affected sites ==
    http://maps.google.com/

    From here it looks like you used Safari instead. Lots of choices that's what I like.
    You did end Firefox and try to restart didn't you?
    If you did then I would expect you have a problem with your Firewall, and would have had it before, does not affect IE, it does affect Firefox, I don't know about other browsers. See
    http://kb.mozillazine.org/Firewalls

  • Struts Validation not working

    As far as I can tell I can't see anything wrong with my validation on struts, but if I put nothing into a required field it doesn't report an error. Any ideas? Below is the offending code:
    First Validation.xml
    <form-validation>
        <formset>
            <form name="User">
                <field property="email"
                        depends="required,email">
                    <arg0 key="user.email"/>
                </field>
            </form>
        </formset>
    </form-validation>Next my struts-config.xml:
    <form-bean name="User" type="org.apache.struts.validator.DynaValidatorForm">
             <form-property name="userName" type="java.lang.String"/>
             <form-property name="password" type="java.lang.String"/>
             <form-property name="firstName" type="java.lang.String"/>
             <form-property name="lastName" type="java.lang.String"/>
             <form-property name="email" type="java.lang.String"/>
    </form-bean>next the jsp code:
    <html:form action="/profile?action=save">
    <html:errors/><BR><BR>
    <tr>
         <td align="left" valign="top"><font face="Arial, Helvetica" size="2">Email:</font></td>
         <td></td>
         <td align="left"><html:text property="email" size="35" maxlength="255" /><br><font size="1"><i>(Your name @ your company web site address)</i></font></td>
    </tr>
    </form>And my Action code:
              else if (action.equals("save")){
                   errors = form.validate(mapping, request);
                   if ((errors == null) || (errors.isEmpty())){
                        //Save Item goes here
                        return (mapping.findForward("Profile"));
                   else {
                        saveErrors(request, errors);
                        return (mapping.findForward("show"));
              }And my validator-rules.xml (it is the default one that comes with struts, but I included it just in case)
    <form-validation>
       <global>
          <validator name="required"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateRequired"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                      msg="errors.required">
             <javascript><![CDATA[
                function validateRequired(form) {
                    var isValid = true;
                    var focusField = null;
                    var i = 0;
                    var fields = new Array();
                    oRequired = new required();
                    for (x in oRequired) {
                         var field = form[oRequired[x][0]];
                        if (field.type == 'text' ||
                            field.type == 'textarea' ||
                            field.type == 'file' ||
                            field.type == 'select-one' ||
                            field.type == 'radio' ||
                            field.type == 'password') {
                            var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
                            if (trim(value).length == 0) {
                                 if (i == 0) {
                                     focusField = field;
                                 fields[i++] = oRequired[x][1];
                                 isValid = false;
                    if (fields.length > 0) {
                       focusField.focus();
                       alert(fields.join('\n'));
                    return isValid;
                // Trim whitespace from left and right sides of s.
                function trim(s) {
                    return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
                ]]>
             </javascript>
          </validator>
          <validator name="requiredif"
                     classname="org.apache.struts.validator.FieldChecks"
                     method="validateRequiredIf"
                     methodParams="java.lang.Object,
                                   org.apache.commons.validator.ValidatorAction,
                                   org.apache.commons.validator.Field,
                                   org.apache.struts.action.ActionErrors,
                                   org.apache.commons.validator.Validator,
                                   javax.servlet.http.HttpServletRequest"
                     msg="errors.required">
          </validator>
          <validator name="minlength"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMinLength"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.minlength">
             <javascript><![CDATA[
                function validateMinLength(form) {
                    var isValid = true;
                    var focusField = null;
                    var i = 0;
                    var fields = new Array();
                    oMinLength = new minlength();
                    for (x in oMinLength) {
                        var field = form[oMinLength[x][0]];
                        if (field.type == 'text' ||
                            field.type == 'textarea') {
                            var iMin = parseInt(oMinLength[x][2]("minlength"));
                            if ((trim(field.value).length > 0) && (field.value.length < iMin)) {
                                if (i == 0) {
                                    focusField = field;
                                fields[i++] = oMinLength[x][1];
                                isValid = false;
                    if (fields.length > 0) {
                       focusField.focus();
                       alert(fields.join('\n'));
                    return isValid;
                }]]>
             </javascript>
          </validator>
          <validator name="maxlength"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMaxLength"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.maxlength">
             <javascript><![CDATA[
                function validateMaxLength(form) {
                    var isValid = true;
                    var focusField = null;
                    var i = 0;
                    var fields = new Array();
                    oMaxLength = new maxlength();
                    for (x in oMaxLength) {
                        var field = form[oMaxLength[x][0]];
                        if (field.type == 'text' ||
                            field.type == 'textarea') {
                            var iMax = parseInt(oMaxLength[x][2]("maxlength"));
                            if (field.value.length > iMax) {
                                if (i == 0) {
                                    focusField = field;
                                fields[i++] = oMaxLength[x][1];
                                isValid = false;
                    if (fields.length > 0) {
                       focusField.focus();
                       alert(fields.join('\n'));
                    return isValid;
                }]]>
             </javascript>
          </validator>
          <validator name="mask"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMask"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.invalid">
             <javascript><![CDATA[
                function validateMask(form) {
                    var isValid = true;
                    var focusField = null;
                    var i = 0;
                    var fields = new Array();
                    oMasked = new mask();
                    for (x in oMasked) {
                        var field = form[oMasked[x][0]];
                        if ((field.type == 'text' ||
                             field.type == 'textarea') &&
                             (field.value.length > 0)) {
                            if (!matchPattern(field.value, oMasked[x][2]("mask"))) {
                                if (i == 0) {
                                    focusField = field;
                                fields[i++] = oMasked[x][1];
                                isValid = false;
                    if (fields.length > 0) {
                       focusField.focus();
                       alert(fields.join('\n'));
                    return isValid;
                function matchPattern(value, mask) {
                   return mask.exec(value);
                }]]>
             </javascript>
          </validator>
          <validator name="byte"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateByte"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.byte"
           jsFunctionName="ByteValidations">
             <javascript><![CDATA[
                function validateByte(form) {
                    var bValid = true;
                    var focusField = null;
                    var i = 0;
                    var fields = new Array();
                    oByte = new ByteValidations();
                    for (x in oByte) {
                         var field = form[oByte[x][0]];
                        if (field.type == 'text' ||
                            field.type == 'textarea' ||
                            field.type == 'select-one' ||
                                  field.type == 'radio') {
                                  var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
                            if (value.length > 0) {
                                if (!isAllDigits(value)) {
                                    bValid = false;
                                    if (i == 0) {
                                        focusField = field;
                                    fields[i++] = oByte[x][1];
                                } else {
                                     var iValue = parseInt(value);
                                     if (isNaN(iValue) || !(iValue >= -128 && iValue <= 127)) {
                                         if (i == 0) {
                                             focusField = field;
                                         fields[i++] = oByte[x][1];
                                         bValid = false;
                    if (fields.length > 0) {
                       focusField.focus();
                       alert(fields.join('\n'));
                    return bValid;
                }]]>
             </javascript>
          </validator>
          <validator name="short"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateShort"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.short"
           jsFunctionName="ShortValidations">
             <javascript><![CDATA[
                function validateShort(form) {
                    var bValid = true;
                    var focusField = null;
                    var i = 0;
                    var fields = new Array();
                    oShort = new ShortValidations();
                    for (x in oShort) {
                         var field = form[oShort[x][0]];
                        if (field.type == 'text' ||
                            field.type == 'textarea' ||
                            field.type == 'select-one' ||
                            field.type == 'radio') {
                            var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                            value = field.options[si].value;
                                  } else {
                                       value = field.value;
                            if (value.length > 0) {
                                if (!isAllDigits(value)) {
                                    bValid = false;
                                    if (i == 0) {
                                        focusField = field;
                                    fields[i++] = oShort[x][1];
                                } else {
                                     var iValue = parseInt(value);
                                     if (isNaN(iValue) || !(iValue >= -32768 && iValue <= 32767)) {
                                         if (i == 0) {
                                             focusField = field;
                                         fields[i++] = oShort[x][1];
                                         bValid = false;
                    if (fields.length > 0) {
                       focusField.focus();
                       alert(fields.join('\n'));
                    return bValid;
                }]]>
             </javascript>
          </validator>
          <validator name="integer"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateInteger"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.integer"
           jsFunctionName="IntegerValidations">
             <javascript><![CDATA[
                function validateInteger(form) {
                    var bValid = true;
                    var focusField = null;
                    var i = 0;
                    var fields = new Array();
                    oInteger = new IntegerValidations();
                    for (x in oInteger) {
                         var field = form[oInteger[x][0]];
                        if (field.type == 'text' ||
                            field.type == 'textarea' ||
                            field.type == 'select-one' ||
                            field.type == 'radio') {
                            var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                      if (si >= 0) {
                                           value = field.options[si].value;
                                  } else {
                                       value = field.value;
                            if (value.length > 0) {
                                if (!isAllDigits(value)) {
                                    bValid = false;
                                    if (i == 0) {
                                         focusField = field;
                                          fields[i++] = oInteger[x][1];
                                } else {
                                     var iValue = parseInt(value);
                                     if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647)) {
                                         if (i == 0) {
                                             focusField = field;
                                         fields[i++] = oInteger[x][1];
                                         bValid = false;
                    if (fields.length > 0) {
                       focusField.focus();
                       alert(fields.join('\n'));
                    return bValid;
                function isAllDigits(argvalue) {
                    argvalue = argvalue.toString();
                    var validChars = "0123456789";
                    var startFrom = 0;
                    if (argvalue.substring(0, 2) == "0x") {
                       validChars = "0123456789abcdefABCDEF";
                       startFrom = 2;
                    } else if (argvalue.charAt(0) == "0") {
                       validChars = "01234567";
                       startFrom = 1;
                    } else if (argvalue.charAt(0) == "-") {
                        startFrom = 1;
                    for (var n = startFrom; n < argvalue.length; n++) {
                        if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) return false;
                    return true;
                }]]>
             </javascript>
          </validator>
          <validator name="long"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateLong"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.long"/>
          <validator name="float"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateFloat"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.float"
           jsFunctionName="FloatValidations">
             <javascript><![CDATA[
                function validateFloat(form) {
                    var bValid = true;
                    var focusField = null;
                    var i = 0;
                    var fields = new Array();
                    oFloat = new FloatValidations();
                    for (x in oFloat) {
                         var field = form[oFloat[x][0]];
                        if (field.type == 'text' ||
                            field.type == 'textarea' ||
                            field.type == 'select-one' ||
                            field.type == 'radio') {
                             var value = '';
                                  // get field's value
                                  if (field.type == "select-one") {
                                       var si = field.selectedIndex;
                                       if (si >= 0) {
                                           value = field.options[si].value;
                                  } else {
                                       value = field.value;
                            if (value.length > 0) {
                                // remove '.' before checking digits
                                var tempArray = value.split('.');
                                var joinedString= tempArray.join('');
                                if (!isAllDigits(joinedString)) {
                                    bValid = false;
                                    if (i == 0) {
                                        focusField = field;
                                    fields[i++] = oFloat[x][1];
                                } else {
                                     var iValue = parseFloat(value);
                                     if (isNaN(iValue)) {
                                         if (i == 0) {
                                             focusField = field;
                                         fields[i++] = oFloat[x][1];
                                         bValid = false;
                    if (fields.length > 0) {
                       focusField.focus();
                       alert(fields.join('\n'));
                    return bValid;
                }]]>
             </javascript>
          </validator>
          <validator name="double"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateDouble"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.double"/>
          <validator name="date"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateDate"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionErrors,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.date"
           jsFunctionName="DateValidations">
             <javascript><![CDATA[
                function validateDate(form) {
                   var bValid = true;
                   var focusField = null;
                   var i = 0;
                   var fields = new Array();
                   oDate = new DateValidations();
                   for (x in oDate) {
                       var value = form[oDate[x][0]].value;
                       var datePattern = oDate[x][2]("datePatternStrict");
                       if ((form[oDate[x][0]].type == 'text' ||
                            form[oDate[x][0]].type == 'textarea') &&
                           (value.length > 0) &&
                           (datePattern.length > 0)) {
                         var MONTH = "MM";
                         var DAY = "dd";
                         var YEAR = "yyyy";
                         var orderMonth = datePattern.indexOf(MONTH);
                         var orderDay = datePattern.indexOf(DAY);
                         var orderYear = datePattern.indexOf(YEAR);
                         if ((orderDay < orderYear && orderDay > orderMonth)) {
                             var iDelim1 = orderMonth + MONTH.length;
                             var iDelim2 = orderDay + DAY.length;
                             var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
                             var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
                             if (iDelim1 == orderDay && iDelim2 == orderYear) {
                                dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
                             } else if (iDelim1 == orderDay) {
                                dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
                             } else if (iDelim2 == orderYear) {
                                dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
                             } else {
                                dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
                             var matched = dateRegexp.exec(value);
                             if(matched != null) {
                                if (!isValidDate(matched[2], matched[1], matched[3])) {
                                   if (i == 0) {
                                       focusField = form[oDate[x][0]];
                                   fields[i++] = oDate[x][1];
                                   bValid =  false;
                             } else {
                                if (i == 0) {
                                    focusField = form[oDate[x][0]];
                                fields[i++] = oDate[x][1];
                                bValid =  false;
                         } else if ((orderMonth < orderYear && orderMonth > orderDay)) {
                             var iDelim1 = orderDay + DAY.length;
                             var iDelim2 = orderMonth + MONTH.length;
                             var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
                             var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
                             if (iDelim1 == orderMonth && iDelim2 == orderYear) {
                                 dateRegexp = new RegExp("^(\\d{2})(\\d{2})(\\d{4})$");
                             } else if (iDelim1 == orderMonth) {
                                 dateRegexp = new RegExp("^(\\d{2})(\\d{2})[" + delim2 + "](\\d{4})$");
                             } else if (iDelim2 == orderYear) {
                                 dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})(\\d{4})$");
                             } else {
                                 dateRegexp = new RegExp("^(\\d{2})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{4})$");
                             var matched = dateRegexp.exec(value);
                             if(matched != null) {
                                 if (!isValidDate(matched[1], matched[2], matched[3])) {
                                     if (i == 0) {
                                         focusField = form[oDate[x][0]];
                                     fields[i++] = oDate[x][1];
                                     bValid =  false;
                             } else {
                                 if (i == 0) {
                                     focusField = form[oDate[x][0]];
                                 fields[i++] = oDate[x][1];
                                 bValid =  false;
                         } else if ((orderMonth > orderYear && orderMonth < orderDay)) {
                             var iDelim1 = orderYear + YEAR.length;
                             var iDelim2 = orderMonth + MONTH.length;
                             var delim1 = datePattern.substring(iDelim1, iDelim1 + 1);
                             var delim2 = datePattern.substring(iDelim2, iDelim2 + 1);
                             if (iDelim1 == orderMonth && iDelim2 == orderDay) {
                                 dateRegexp = new RegExp("^(\\d{4})(\\d{2})(\\d{2})$");
                             } else if (iDelim1 == orderMonth) {
                                 dateRegexp = new RegExp("^(\\d{4})(\\d{2})[" + delim2 + "](\\d{2})$");
                             } else if (iDelim2 == orderDay) {
                                 dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})(\\d{2})$");
                             } else {
                                 dateRegexp = new RegExp("^(\\d{4})[" + delim1 + "](\\d{2})[" + delim2 + "](\\d{2})$");
                             var matched = dateRegexp.exec(value);
                             if(matched != null) {
                                 if (!isValidDate(matched[3], matched[2], matched[1])) {
                                     if (i == 0) {
                                         focusField = form[oDate[x][0]];
                                      fields[i++] = oDate[x][1];
                                      bValid =  false;
                              } else {
                                  if (i == 0) {
                                      focusField = form[oDate[x][0]];
                                  fields[i++] = oDate[x][1];
                                  bValid =  false;
                         } else {
                             if (i == 0) {
                                 focusField = form[oDate[x][0]];
                             fields[i++] = oDate[x][1];
                             bValid =  false;
                   if (fields.length > 0) {
                      focusField.focus();
                      alert(fields.join('\n'));
                   return bValid;
             function isValidDate(day, month, year) {
                 if (month < 1 || month > 12) {
                        return false;
                    if (day < 1 || day > 31) {
                        return false;
                    if ((month == 4 || month == 6 || month == 9 || month == 11) &&
                        (day == 31)) {
                        return false;
                    if (month == 2) {
                        var leap = (year % 4 == 0 &&
                                   (year % 100 != 0 || year % 400 == 0));
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

    Next my struts-config.xml:That's all? What about an <action-mappings> section
    which specifies the action URIs and whether or not
    validation is turned on for specific ones?Whoops, sorry I forgot to put my action, although you just made me figure out the answer. I forgot I have 2 versions of the bean, one called Profile and one Called User, and I was trying to test the validation on the Profile bean while I was specifying the User bean :)

  • Spry Validations not working javascript:Spry.Widget.Form.destroyAll() in popup

    iam using spry to validate controls in a popup.in that
    validations are working fine but the problem is when we click
    cancel button also thse validations are firing...
    i am using
    javascript:Spry.Widget.Form.destroyAll() to destroy
    validations...but it is not working.
    when we click on cancel button how to destroy the validations
    as well as hide the popup...
    can anyone help me...

    Thanks! (While I'm REALLY not comfortable with code yet (working on it :-) I atleast understood that it was a PHP issue (yay).
    Studied the code in the examples in the book. And added:
    <pre>
    <?php if ($_POST) {print_r($_POST);} ?>
    </pre>
    It worked.  (I'm local testing, with no connection to a database yet. Just trying to get the basic pages to work first.)
    Hopefully the more I work on all of this, the more I'll begin to "get it"! And I'm almost up to the Chapter on PHP. So, I'm hoping to will become clearer as I read on.
    Thanks for the help in pointing me in the right direction!!!
    -- Jami

  • Plz Solve this Error in    " Client Side Address Validation in Struts "

    Hi,
    i have created struts project and foll code is written as foll :
    plz find out error in code :
    struts-config.xml code
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <data-sources />
    <form-beans >
    <form-bean name="AddressForm" type="com.projectvalidator.form.AddressForm" />
    </form-beans>
    <global-exceptions />
    <global-forwards />
    <action-mappings >
    <action
    input="/validateaddress.jsp"
    name="AddressForm"
    path="/address"
    scope="request"
    validate="true"
    type="com.projectvalidator.action.AddressAction">
    <forward name="success" path="/success.jsp"/>
    <forward name="failure" path="/validateaddress.jsp"/>
    </action>
    </action-mappings>
    <message-resources parameter="MessageResources" />
    <!-- Validator plugin -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
    </struts-config>
    MessageResources.properties file code
    AddressForm.name=Name      
    AddressForm.address=Address
    AddressForm.email=EmailAddress
    validation.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <form-validation>
    <formset>
    <!-- Address form Validation-->
    <form name="AddressForm">
    <field property="name"
    depends="required" >
    <arg key="AddressForm.name"/>
    </field>
    <field property="address"
    depends="required" >
    <arg key="AddressForm.address"/>
    </field>
    <field property="email"
    depends="required" >
    <arg key="AddressForm.email"/>
    </field>
    </form>
    </formset>
    </form-validation>
    validationaddress.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html locale="true">
    <head>
    <html:base />
    <title>validateaddress.jsp</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    </head>
    <body bgcolor=#fdffca>
    <html:form action="/address" method="post" onsubmit="return validateAddressForm(this);">
    <p>
    <html:errors/><p>
    name : <html:text property="name" size="30" maxlength="30" />
    address : <html:text property="address" size="30" maxlength="30" />
    emailaddress : <html:text property="email" size="30" maxlength="30" />
    <html:submit>Submit</html:submit>
    <html:cancel>Cancel</html:cancel>
    <!-- Begin Validator Javascript Function-->
    <html:javascript formName="AddressForm"/>
    <!-- End of Validator Javascript Function-->
              </html:form>
         </body>
    </html:html>
    AddressForm.java
    //Created by MyEclipse Struts
    // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.9.210/xslt/JavaClass.xsl
    package com.projectvalidator.form;
    import org.apache.struts.validator.ValidatorForm;
    * MyEclipse Struts
    * Creation date: 02-23-2006
    * XDoclet definition:
    * @struts:form name="AddressForm"
    public class AddressForm extends ValidatorForm {
         // --------------------------------------------------------- Instance Variables
         /** address property */
         private String address;
         /** emailaddress property */
         private String email;
         /** name property */
         private String name;
         // --------------------------------------------------------- Methods
         * Returns the address.
         * @return String
         public String getAddress() {
              return address;
         * Set the address.
         * @param address The address to set
         public void setAddress(String address) {
              this.address = address;
         * Returns the emailaddress.
         * @return String
         public String getEmail() {
              return email;
         * Set the emailaddress.
         * @param emailaddress The emailaddress to set
         public void setEmail(String email) {
              this.email = email;
         * Returns the name.
         * @return String
         public String getName() {
              return name;
         * Set the name.
         * @param name The name to set
         public void setName(String name) {
              this.name = name;
    AddressAction.java
    //Created by MyEclipse Struts
    // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.9.210/xslt/JavaClass.xsl
    package com.projectvalidator.action;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.projectvalidator.form.AddressForm;
    * MyEclipse Struts
    * Creation date: 02-23-2006
    * XDoclet definition:
    * @struts:action path="/address" name="AddressForm" input="/validateaddress.jsp" scope="request" validate="true"
    * @struts:action-forward name="success" path="success.jsp" redirect="true"
    * @struts:action-forward name="failure" path="validateaddress.jsp" redirect="true"
    public class AddressAction extends Action {
         // --------------------------------------------------------- Instance Variables
         // --------------------------------------------------------- Methods
         * Method execute
         * @param mapping
         * @param form
         * @param request
         * @param response
         * @return ActionForward
         public ActionForward execute(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response) {
              AddressForm AddressForm = (AddressForm) form;
              // TODO Auto-generated method stub
              //String forward="";
              //if (AddressForm.getName().equalsIgnoreCase("admin"));
              //return mapping.findForward(forward);
              return null;
    ==========================================
    PLZ REPLY ME ANYONE , I AM NOT GETTING OUTPUT , i am using jboss application server, i am getting a pop-up window as below:
    null is required
    null is required
    null is required
    i hope any one replies me

    Hi,
    i have created struts project and foll code is written as foll :
    plz find out error in code :
    struts-config.xml code
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <data-sources />
    <form-beans >
    <form-bean name="AddressForm" type="com.projectvalidator.form.AddressForm" />
    </form-beans>
    <global-exceptions />
    <global-forwards />
    <action-mappings >
    <action
    input="/validateaddress.jsp"
    name="AddressForm"
    path="/address"
    scope="request"
    validate="true"
    type="com.projectvalidator.action.AddressAction">
    <forward name="success" path="/success.jsp"/>
    <forward name="failure" path="/validateaddress.jsp"/>
    </action>
    </action-mappings>
    <message-resources parameter="MessageResources" />
    <!-- Validator plugin -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
    </struts-config>
    MessageResources.properties file code
    AddressForm.name=Name      
    AddressForm.address=Address
    AddressForm.email=EmailAddress
    validation.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <form-validation>
    <formset>
    <!-- Address form Validation-->
    <form name="AddressForm">
    <field property="name"
    depends="required" >
    <arg key="AddressForm.name"/>
    </field>
    <field property="address"
    depends="required" >
    <arg key="AddressForm.address"/>
    </field>
    <field property="email"
    depends="required" >
    <arg key="AddressForm.email"/>
    </field>
    </form>
    </formset>
    </form-validation>
    validationaddress.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html locale="true">
    <head>
    <html:base />
    <title>validateaddress.jsp</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    </head>
    <body bgcolor=#fdffca>
    <html:form action="/address" method="post" onsubmit="return validateAddressForm(this);">
    <p>
    <html:errors/><p>
    name : <html:text property="name" size="30" maxlength="30" />
    address : <html:text property="address" size="30" maxlength="30" />
    emailaddress : <html:text property="email" size="30" maxlength="30" />
    <html:submit>Submit</html:submit>
    <html:cancel>Cancel</html:cancel>
    <!-- Begin Validator Javascript Function-->
    <html:javascript formName="AddressForm"/>
    <!-- End of Validator Javascript Function-->
              </html:form>
         </body>
    </html:html>
    AddressForm.java
    //Created by MyEclipse Struts
    // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.9.210/xslt/JavaClass.xsl
    package com.projectvalidator.form;
    import org.apache.struts.validator.ValidatorForm;
    * MyEclipse Struts
    * Creation date: 02-23-2006
    * XDoclet definition:
    * @struts:form name="AddressForm"
    public class AddressForm extends ValidatorForm {
         // --------------------------------------------------------- Instance Variables
         /** address property */
         private String address;
         /** emailaddress property */
         private String email;
         /** name property */
         private String name;
         // --------------------------------------------------------- Methods
         * Returns the address.
         * @return String
         public String getAddress() {
              return address;
         * Set the address.
         * @param address The address to set
         public void setAddress(String address) {
              this.address = address;
         * Returns the emailaddress.
         * @return String
         public String getEmail() {
              return email;
         * Set the emailaddress.
         * @param emailaddress The emailaddress to set
         public void setEmail(String email) {
              this.email = email;
         * Returns the name.
         * @return String
         public String getName() {
              return name;
         * Set the name.
         * @param name The name to set
         public void setName(String name) {
              this.name = name;
    AddressAction.java
    //Created by MyEclipse Struts
    // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.9.210/xslt/JavaClass.xsl
    package com.projectvalidator.action;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.projectvalidator.form.AddressForm;
    * MyEclipse Struts
    * Creation date: 02-23-2006
    * XDoclet definition:
    * @struts:action path="/address" name="AddressForm" input="/validateaddress.jsp" scope="request" validate="true"
    * @struts:action-forward name="success" path="success.jsp" redirect="true"
    * @struts:action-forward name="failure" path="validateaddress.jsp" redirect="true"
    public class AddressAction extends Action {
         // --------------------------------------------------------- Instance Variables
         // --------------------------------------------------------- Methods
         * Method execute
         * @param mapping
         * @param form
         * @param request
         * @param response
         * @return ActionForward
         public ActionForward execute(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response) {
              AddressForm AddressForm = (AddressForm) form;
              // TODO Auto-generated method stub
              //String forward="";
              //if (AddressForm.getName().equalsIgnoreCase("admin"));
              //return mapping.findForward(forward);
              return null;
    ==========================================
    PLZ REPLY ME ANYONE , I AM NOT GETTING OUTPUT , i am using jboss application server, i am getting a pop-up window as below:
    null is required
    null is required
    null is required
    i hope any one replies me

  • When i insert the menu.js file the validations(javascript) is not works

    i write the following code into "menu.js" file ie. for menu bar its work finely. I write one jsp file in that i write the code for insert record with the validatations eg. check whether its number or not/ integer or not.
    In this jsp file i include the .js file ie. menu.js.
    ============== In jsp file ===================
    <table align=center width=100%>
         <tr>
              <td>
                        <script type='text/javascript' src='menu/menu.js'></script>
              </td>
         </tr>
    </table>
    =================================
    But problem is this when i insert the above 5 or 6 lines into jsp file at run time validation script is not working and when i remove the
    above code then validation script is works.
    So experts i want works both means the menu and the validation script.

    andy_surya wrote:
    i write the following code into "menu.js" file ie. for menu bar its work finely. I write one jsp file in that i write the code for insert record with the validatations eg. check whether its number or not/ integer or not.
    In this jsp file i include the .js file ie. menu.js.
    ============== In jsp file ===================
    <table align=center width=100%>
         <tr>
              <td>
                        <script type='text/javascript' src='menu/menu.js'></script>
              </td>
         </tr>
    </table>
    =================================
    But problem is this when i insert the above 5 or 6 lines into jsp file at run time validation script is not working and when i remove the
    above code then validation script is works.
    So experts i want works both means the menu and the validation script.Despite the confusion there seems to be in many threads (which is scary to me somehow) this forum is not about JavaScript.
    You need to debug your JavaScript problem. I suggest starting by using Firefox and then using Tools->Error Console and see what's up. By your description you have two different JavaScripts with conflicting functions or something.

  • Struts validation not working properly

    Hi,
    I'm using the struts validator to validate my form.. I've followed all the steps required.. I've checked it quite a few times :)
    Currently I want to verify if my form fields have any value, so am verifying the required property.. but when I submit an empty form, it doesn't show an error.. but the log shows the following;
    Any suggestions what could be missing?
    2005-08-11 16:20:08,804 [http-8080-Processor25] ERROR org.apache.struts.validator.ValidatorForm - org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest)
    org.apache.commons.validator.ValidatorException: org.apache.struts.validator.FieldChecks.validateRequired(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest)
         at org.apache.commons.validator.ValidatorAction.loadValidationMethod(ValidatorAction.java:627)
         at org.apache.commons.validator.ValidatorAction.executeValidationMethod(ValidatorAction.java:557)
         at org.apache.commons.validator.Field.validateForRule(Field.java:827)
         at org.apache.commons.validator.Field.validate(Field.java:906)
         at org.apache.commons.validator.Form.validate(Form.java:174)
         at org.apache.commons.validator.Validator.validate(Validator.java:367)
         at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)
         at org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:942)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:255)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

    I had a similar problem upgrading from struts 1.1 to 1.2.7. The method signatures in FieldChecks changed to include a Validator object:
    1.1
    validateRequired(java.lang.Object bean, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field, ActionErrors errors, javax.servlet.http.HttpServletRequest request)
    1.2.7
    validateRequired(java.lang.Object bean, org.apache.commons.validator.ValidatorAction va, org.apache.commons.validator.Field field, ActionMessages errors, org.apache.commons.validator.Validator validator, javax.servlet.http.HttpServletRequest request)
    After I added org.apache.commons.validator.Validator to the methodParams attribute of validator in validator-rules.xml I no longer got the error (which was a NoSuchMethodException... I had to look at the ValidatorAction code to find that out, for some reason it wasn't in the stack trace).

Maybe you are looking for

  • How get report of all user assigned tcode & object activety wise

    Dear All, We need to get report of user assign tcode & assign tcode wise activety. Regards jitendra Singh

  • JAXB Unmarshalling and namespace

    Hi All , Im using jaxb to marshall and unmarshall xml messages.Every thing seems to work fine expect for one small part ...... the namespace is removed form the xml .For example <RECORD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noName

  • Oracle exporting query

    Hi, I was wondering if there is a way in standard oracle 10g for exporting of query result to a file? This is the scenario, I have a script which have a simple query, eg, select * from tableA. I would like to be able to run a sql command to the datab

  • Not showing Variable screen in Workbook - Refresh

    Hi BW Experts, I am working on BI 7.0 When I try to refresh Workbook in Analyzer it is refreshing the query giving current data, but it is not showing Variable screen. What should I do to open variable screen when I click on Refresh button in Workboo

  • How to leave account setup screen

    recently I upgraded to OSx Yosemite, and needed to remake an admin account using the mount -uw and .applesetupdone, but once I finish with the new account setup, it says "creating account" and then goes back to the "welcome, choose country" screen an