struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duan Qiang" <qd...@ilog.com.sg>
Subject Re: how to get the formbean in script
Date Fri, 20 Jun 2003 05:33:30 GMT
Hi, Kandi,

Thx for the message. What I wanted to do is to get the formbean in script so
that I can use the formbean in java codes in JSP. From Hrishi's reply I
understand that when I use <bean:define id="id" name="formbean" />, it must
be after the <html:form  tag.

Then I can use the formbean in java,  like the following.

<%
String name = (String)formbean.get("name");
...
%>

Cheers,

dq
----- Original Message -----
From: "Kandi Potter" <Kandi.Potter@PWGSC.GC.CA>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Friday, June 20, 2003 12:42 AM
Subject: RE: how to get the formbean in script


> Is this what you are looking for?
>
> ..something like this in your struts-config.xml:
>
> <form-beans>
>
>
>     <!-- HomePage form bean -->
>     <form-bean      name="incidentForm"
>                     type="pwgsc.smis.presentation.IncidentForm"/>
> </form-beans>
>
> <!-- Process an incident request for opening a new or existing incident-->
>     <action    path="/incident"
>                type="pwgsc.smis.actions.maintainHO.IncidentAction"
>                name="incidentForm"
>    scope="request"
>    validate="true"
>    input="/incident.jsp"
>            >
> <forward name="incident"        path="/incident.jsp"/>
>   <forward name="unsafe" path="/unsafe.do"/>
> <forward name="contributing"    path="/contributing.do"/>
> <forward name="hazardous" path="/hazardous.do"/>
> </action>
>
> and then access from the .jsp something like:
> <html:text name="incidentForm" property="incidentDate" /></td>
>
> -----Original Message-----
> From: Duan Qiang [mailto:qduan@ilog.com.sg]
> Sent: Wednesday, June 18, 2003 10:52 PM
> To: Struts Users Mailing List
> Subject: how to get the formbean in script
>
>
> Hi,
>
> I have a formbean defined as "test", how can I get the formbean in JSP so
> that I can better control it rather than using <bean:write name="test"
> property = "xxx "/>.
>
> I tried to use
>
> <bean:define id="test" name="test" /> but I got the exception that "no
test
> found in any scope".
>
> I have one question, when the formbean is initialized ? when the page
> containing the formbean is shown for the first time, the bean should
exists
> in proper scope? write?
>
> Thx.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>


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


Mime
View raw message