April 2nd, 2003, 11:05 AM
Verifying User Information question
I'm wondering what people's opinions are on this one:
Is it safe to assign user input to bean file variables, and THEN check the information (i.e. for invalid characters), or is it better practice to check the input directly from the request object (request.getParameter("var1")) and only then assign it to bean file variables?
April 6th, 2003, 02:55 PM
I prefer to do assignment validation in the setter method of the variable (in the bean). This makes the bean more independent of the environment it is used in.
April 7th, 2003, 12:56 AM
i prefer bean less redundant programming. If you can make a bean with all types of verification your site uses ur set.