struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Kannan A B <satheesh.kan...@hcl.com>
Subject RE: Iterator: field errors.
Date Fri, 10 Dec 2010 07:15:35 GMT
Hi,
Generic I have given a pojo class List<PojoClassBO> and am doing validation as a separate
method in my action as given below.
 List<PojoClassBO> boList = new ArrayList< PojoClassBO >();

Public String save(){

        If(isValid())
        {
                Continue....
        }else{
Return "input";
}

Return "success";
}

Private Boolean isValid(){
        if(String.isEmpty()){
                addFieldError("bo.FieldName",getText("error.code"));
        }

        if (getFieldErrors().size() > 0) {
                        return true;
        } else{
                Return false;
        }
}



Thanks  and Regards,

Satheesh Kannan A B


-----Original Message-----
From: Li Ying [mailto:liying.cn.2010@gmail.com]
Sent: Friday, December 10, 2010 5:35 AM
To: Struts Users Mailing List
Subject: Re: Iterator: field errors.

What is the data type of objectList?

How did you execute the validation, and how did you add the field error?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named
recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or
opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of
HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and
/ or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited.
If you have
received this email in error please delete it and notify the sender immediately. Before opening
any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------
Mime
View raw message