well the 'benefit' of the jsp:setProperty is sorta kinda covered by the 'request' object, in my opinion. The jsp mega-setter (just use * to set all the properties) is useful when the target of your form submission is another JSP page. Sort of.
The :setProperty only transfers all the params from the request into your bean. But still.. you'd have to the use :getProperty every time you wanted one of the params. Which you'd need to do for processing some sort of business transaction. Same thing in the servlet with request. So where are you saving time by using a bean in a JSP?
Well, ok... the savings is potentially here:
If you were in a servlet, you might be tempted to send an instance of HttpRequest into the business object's OrderTicket method. After all, the request contains all of our fields right? But this is a bad separation of the HTTP layer from the business layer. So what you *should* do is construct a bean that contains all the fields of interest , and pass *that* object to the method. If this were a JSP page, and not a servlet, then you'd certainly save some time by being able to use the mega-setter method.
Having said that, there's nothing stopping you from coding your own little method that does this sort of thing. After all, Sun had to code that "*" behaviour into their jsp:setProperty tag. You could too. I imagine something like:
And yah, it's a bad idea to have
JDBC code in a JSP. Just google for 'model 2 servlet' and you'll find plenty of articles.