![]() |
|
Version: 0.27 - Last update: 2004-05-30 | Home Page - SourceForge Project Page - Contact |
Jodd Overview News Download License References Development Using Jodd Javadoc JUnit report Community Contribute Report a bug More reading Milestone 0.30 ![]() ![]() |
FormsJodd provides a solution for form handling in an very easy way. There is no high-level automatism, everything is at the very same level as the basic Servlets. Jodd introduces few utilities which significantly may help for retrieving posted data from a form as well as populating form.Loading form beansThanks to thejodd.bean.BeanUtil class, form beans can be
very simply loaded from the request:
And that is all. The only thing developer needs to take care off is to name html input fields equally to names of form bean properties. Hint: form beans do not have to be instanced on each request as in above example. Instead, instance can be obtained from some scope etc. Populate forms with magicForm beans that are stored in scopes may be used for populating html forms. And it really looks like magic: create form in plain HTML and surround it by a Jodd's form tag. And that is all!
Jodd's form tag will get all form beans specified in the tag from various source, i.e. scopes. From beans are simple Java beans, which property names must match form's input names. One form may be populated from more than one bean and in this case bean names and their scopes must be comma separated. Working example can be found in the Jodd distribution. |