struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Pelly <gpe...@esri.com>
Subject RE: How to get form from JSP
Date Thu, 21 Apr 2005 19:26:58 GMT
The ActionForm is stored in the request with the same name as the
form-bean's name.  If you have a form bean:

    <form-bean name="loginForm"                                     type =
"project.struts.form.LoginForm" /> 

You can get the form in the JSP like this:

<%
project.struts.form.LoginForm myLoginForm = (project.struts.form.LoginForm)
request.getAttibute("loginForm");
%>

-Greg

-----Original Message-----
From: Wiebe de Jong [mailto:wiebedj@shaw.ca] 
Sent: Thursday, April 21, 2005 9:38 AM
To: 'Struts Users Mailing List'
Subject: RE: How to get form from JSP

The form is already defined as a bean. You can access it using the name you
gave it in your struts-config file.

i.e. <form-bean name="myForm" ...

Wiebe

-----Original Message-----
From: Billy Ng [mailto:kwokng@earthlink.net]
Sent: Thursday, April 21, 2005 9:16 AM
To: Struts Users Mailing List
Subject: How to get form from JSP

Hi all,

Is there a way to get the ActionForm obj in the JSP instead of using
<bean:define> tag

Thanks!

Billy 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message