Is there an equivalent to:
<jsp:setProperty name="beanName" property="*"/>
for servlets?
Something that will auto-populate the bean from inside a servlet using the request parameters? I’m refactoring a JSP-only application and would like to move some of the code to servlets. For a bunch of tragic reasons, we are not able (right now) to use any frameworks to make this easier.
Can you use external libraries? If so, Commons BeanUtils would help you a lot.
Update: Now that you’ve confirmed you can use this approach:
The method you’re looking for is BeanUtils.populate(). There is an example here (chapter 4.2) on how to use it to map request parameters.