What is the best way to create a non-framework (JSP / Servlet only) to create a form so that it can:
- Assume default values ββ/ data loaded from database
- Retry values ββthat are not checked
It seems pretty straightforward to do one or the other, but creating a form that supports both at the same time is a daunting task.
For example, using
${param.scheduledDate}
great for re-displaying a date with a validation error, but cannot be easily set programmatically when the page loads. On the other hand,
${myBean.scheduledDate}
works great for displaying values ββloaded from the database, but cannot re-display data when validation fails, since the bean uses an object of type Date rather than a string.
A few things come to mind, but in fact all this is not so good:
- use intermediate bean with strings only
- use a servlet filter to set parameters when loading a page
source share