hi julia,

you get, as far as I know, only strings for settings. you can validate the
string in your ActionForm within the validate method. you have to look if
the string can be transfered to a integer; when no you can add an error and
redirect back to the jsp.

!!!!
        public void setCompanyID(String newCompanyID) {
                this.companyID = newCompanyID}
!!!!

juraj



-----Urspr�ngliche Nachricht-----
Von: Julia Yang [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 10. September 2001 17:26
An: [EMAIL PROTECTED]
Betreff: Does struts validate input field in JSP type by itself ?


Hi, all
Do you know if struts validate input fields in JSP by itself, which has
matched getter and setter methods in bean,?
For example: You have field called companyID in JSP and in you xxxForm
bean you have 
        int companyID();
        public int getCompanyID(){
                return this.companmyID;}
        public void setCompanyID(int newCompanyID) {
                this.companyID = companyID}
My question is: if I put a String in JSP companyID field, can I let
struts tell me error message that companyID has to be integer ? How ?

Thanks 

Julia
        

Reply via email to