I needs to populate values for listboxes , textboxes .. almost all the form input elements from my servlet . Because sending the object to the JSP page and populating the values for the input elements there (using any tag libraries JSTL) i found it difficult.
Is there anyway for setting all the Input Element values from the servlet itself? For example if i needs to set the value for textfield , then in my servlet
TextFieldBean tf = new TextFieldBean("userName");
tf.setValue("Test");
In my jsp page
<input type="text" name="userName">
That’s what all MVC frameworks (that I know about) allow doing. Here’s an example with Stripes:
MVC frameworks have their own learning curve, but they offer huge services (data binding being one of them). Pick one and learn: Stripes, Spring MVC, Play, … there are dozens of them. I like Stripes for its simplicity and good design.