Re: struts ActionForm w blank fields

2005-11-10 Thread Frank W. Zammetti
You know, the far simpler answer here, assuming null doesn't have any special meaning to your app, is to simply initialize your fields in your ActionForms. I.e., public class myForm extends ActionForm { private String firstName = ""; public void setFirstName(String inFirstName) { firstNam

Re: struts ActionForm w blank fields

2005-11-10 Thread Dave Newton
Chris Pat wrote: What is the best way to handle, in an Action, form fields that are blank? Depends on how you want to handle blank fields, I suppose. Empty fields in a form submision aren't null; they're empty strings. Am I misunderstanding what you mean? Dave ---

Re: struts ActionForm w blank fields

2005-11-10 Thread Frank W. Zammetti
Hi Chris, As with most things, it depends on your app... what would be most appropriate to get from your ActionForm? If you never want to get a null out of it, you can do the check in the accessor of the ActionForm. If it's something that is a valid return, you probably will want to do the check

struts ActionForm w blank fields

2005-11-10 Thread Chris Pat
Hello What is the best way to handle, in an Action, form fields that are blank? If you have a simple getter that just returns the field, how do you handle it when the field is not in the session b/c it was not filled in? Do I just check for fieldName==null in the getter of the ActionForm? tia.