In my project i have:
a servlet that handles http requests with users profile info as parameters, i.e (userName = "Bob" , password = "ugaBaga", address = "blabla"... )
a User class that represents the user info. getters + setters : getName(), setName(String username)....
my question is , is there an easy way to create a new user instance from the httpRequest parameters?
something like :
User newUser = createUserFromParams (new User(), httpRequestParameters);
(without the need to write : user.setName(parameters.getParameter("userName")) for each of my 30~ fields)
p.s - I'm not really sending a password, i couldn't think of a fieldname. the passwords are being sent by sms's ;)
thanks in advance!