Hey!

I'm still pretty new to struts and am taking over an app from a previous
developer. I have added some validation and got the following error:

ValidWhen Error for field ' additionalInfo' - line 1:18: unexpected token: )


Here is the code from Validator-defaults.xml

<form name="DisqualForm">               
        <field property="email" depends="required, email">
                <arg0 key="eJuror.global.label.from"/>
        </field>                
        <field property="additionalInfo" depends="validwhen">
      <arg0 key="ejuror.global.label.additionalInfo"/>
        <var>
          <var-name>test</var-name>
          <var-value>((remarksRequired) or (*this* != null))</var-value>
        </var>
    </field>
</form>

And DisqualForm (Aliased):

/*
 * Author   :   Vincent Fumo
 * Created  :   Apr 25, 2005
 * Modified :   
 * 
 * Copyright (c) ACS Government Systems, Inc. 2005.  All rights reserved.
 * 
 * CONFIDENTIAL BUSINESS INFORMATION
 * 
 * THIS PROGRAM IS PROPRIETARY INFORMATION OF
 * ACS GOVERNMENT SYSTEMS AND IS NOT TO BE COPIED,
 * REPRODUCED, LENT OR DISPOSED OF, NOR USED FOR
 * ANY PURPOSE OTHER THAN THAT FOR WHICH IT IS
 * SPECIFICALLY PROVIDED WITHOUT THE WRITTEN
 * PERMISSION OF ACS.
 */

package com.acs.gs.eJuror.web.forms;

import java.util.Collection;
import java.util.List;

import com.acs.gs.juror.bo.ExcuseCode;

/**
 * @author Vincent Fumo
 * @version 2.1
 */
public class ExDisForm extends AbstractEJValidatorForm {

    /**
     * Comment for <code>serialVersionUID</code>
     */
    private static final long serialVersionUID = 1L;
    private String email;
    private String additionalInfo;
    
    // the list of possible reasons
    private List<ExcuseCode> reasons;
    
    // the selected reason
    private String errorMessage="";
    private String reason;

    public void setReasons(List<ExcuseCode> reasons) {
        this.reasons = reasons;
    }
    
    public boolean isRemarksRequired(){
        if(reason==null||reason.equals("")){
                return false;
        }
        
        for(ExcuseCode exCode:reasons){
                if(reason.equals(exCode.getCode())){
                        return exCode.isRemarksRequired();
                }
        }
        
        return false;
    }

    /**
     * @return Returns the additionalInfo.
     */
    public String getAdditionalInfo() {
        return additionalInfo;
    }
    /**
     * @param additionalInfo The additionalInfo to set.
     */
    public void setAdditionalInfo(String additionalInfo) {
        this.additionalInfo = additionalInfo;
    }
    /**
     * @return Returns the email.
     */
    public String getEmail() {
        return email;
    }
    /**
     * @param email The email to set.
     */
    public void setEmail(String email) {
        this.email = email;
    }
    /**
     * @return Returns the reason.
     */
    public String getReason() {
        return reason;
    }
    /**
     * @param reason The reason to set.
     */
    public void setReason(String reason) {
        this.reason = reason;
    }
    /**
     * @return Returns the reasons.
     */
    public Collection getReasons() {
        return reasons;
    }

        /**
         * @return the errorMessage
         */
        public String getErrorMessage() {
                return errorMessage;
        }

        /**
         * @param errorMessage the errorMessage to set
         */
        public void setErrorMessage(String errorMessage) {
                if(errorMessage==null){
                        this.errorMessage = "";
                }
                else{
                        this.errorMessage = errorMessage;
                }
        }
}

Any ideas?

thanks


Thom Hehl
Software Engineer, Juror Solutions
* Office (859) 277-8800 x 144
* [EMAIL PROTECTED]

ACS, Inc.
Government Solutions
1733 Harrodsburg Road
Lexington, KY 40504-3617

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information.  Any unauthorized review, use, disclosure or distribution is
prohibited.  If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message and
notify sender via e-mail at [EMAIL PROTECTED] or by telephone at
859-277-8800 ext. 144.  Thank you.


Reply via email to