set properties of usebean after translation of jsp

Hi,

I would like to set usebean properties on a jsp using the values of the form parameters that appear on the same jsp and after that send the request object right away to a servlet.

Unfortunately the usebean properties already get set when at translation of the jsp (as it seems to me). The request object is then still empty and therefore so are the properties of the bean.

Is there any way so set usebean properties after the form parameters are filled.

Thanks and regards,

dampe hin

[526 byte] By [dampe_hina] at [2007-11-26 22:41:17]
# 1

> Is there any way so set usebean properties after the

> form parameters are filled.

There is a way. If your form's action is blank, then the form submits to the same JSP, and you can read the form parameters with Http Request getParameter("parameter_name")

And then populate the JavaBean with jsp:useBean

But the above approach is bad design.

Normally, with MVC - which is better design - one submits the form to a Servlet , the servlet then reads the HttpRequest and then calls a method which populates the JavaBean.

JSPs are useful for displaying information , so storing and processing information should be differed to the application and database layer.

appy77a at 2007-7-10 11:56:05 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...