#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    2
    Rep Power
    0

    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?

    Dan
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    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.
  4. #3
  5. dont click here
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    409
    Rep Power
    12
    i prefer bean less redundant programming. If you can make a bean with all types of verification your site uses ur set.

IMN logo majestic logo threadwatch logo seochat tools logo