You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Sifuentes, Ben" <Be...@McKesson.com> on 2004/01/02 20:44:43 UTC
DynaActionForm question
I have been trying to do the following:
<form-bean
name="searchForm"
type="com.mckesson.eig.actions.search.patient.SearchForm">
<form-property name="facilities"
type="java.util.ArrayList"/>
<form-property name="sexes"
type="java.util.ArrayList"/>
<form-property name="age" type="java.lang.String"/>
<form-property name="admissionDate"
type="java.lang.String"/>
<form-property name="admissionDays"
type="java.lang.String"/>
<form-property name="ageRange"
type="java.lang.String"/>
<form-property name="dateOfBirth"
type="java.lang.String"/>
<form-property name="dischargeDate"
type="java.lang.String"/>
<form-property name="dischargeDays"
type="java.lang.String"/>
<form-property name="encounterNumber"
type="java.lang.String"/>
<form-property name="mrn" type="java.lang.String"/>
<form-property name="ssn" type="java.lang.String"/>
<form-property name="gpi" type="java.lang.String"/>
<form-property name="firstName"
type="java.lang.String"/>
<form-property name="lastName"
type="java.lang.String"/>
<form-property name="patients"
type="java.util.ArrayList"
className="com.mckesson.eig.common.struts.NullInitialPropertyConfig"/>
<form-property name="selectedSex"
type="java.lang.String"/>
<form-property name="selectedFacilityCode"
type="java.lang.String"/>
<form-property name="currentPatientIndex"
type="java.lang.Integer"/>
<form-property name="selectedEncounters"
type="java.util.ArrayList"/>
<form-property name="selectedEncounter"
type="java.lang.String"/>
<form-property name="chartSelectedEncounters"
type="java.lang.String[]"/>
<form-property name="chartSelectedMrn"
type="java.lang.String"/>
<form-property name="chartSelectedFacility"
type="java.lang.String"/>
<form-property name="popupProperties"
type="com.mckesson.eig.common.presentation.properties.WindowPopupProperties"
/>
</form-bean>
<action
path="/remoteParam"
type="com.mckesson.eig.actions.RemoteParameterAction">
attribute="searchForm"
scope="session"
validate="false">
</action>
Based on the following struts documentation this should have worked?
<action path="/editRegistration"
type="org.apache.struts.webapp.example.EditRegistrationAction"
attribute="registrationForm"
scope="request"
validate="false">
<forward name="success path="/registration.jsp"/>
</action>
When the /editRegistration action is invoked, a registrationForm is
created and added to the request, but its validate method is not called. The
default value of the validate attribute is true, so if you do not want an
action to trigger form validation, you need to remember to add this
attribute and set it to false.
So now when I print off the session values when the action is fired
these attributes are the only ones that exists:
[02 Jan 2004 13:40:58,699] [RemoteParameterAction] Scope: session
[02 Jan 2004 13:40:58,699] [RemoteParameterAction] searchForm must
be null in session
[02 Jan 2004 13:40:58,709] [RemoteParameterAction] name: SWIM_USER
[02 Jan 2004 13:40:58,779] [RemoteParameterAction] name:
SWIM_FACILITY
[02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
SESSION_MANAGER
[02 Jan 2004 13:40:58,789] [RemoteParameterAction] name: SWIM_MRN
[02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
org.apache.struts.action.LOCALE
[02 Jan 2004 13:40:58,789] [RemoteParameterAction] Our Form is
null........
[02 Jan 2004 13:40:58,789] [RemoteParameterAction] Controller
contains Mrn: [032599]
I was expecting to see a searchForm in the session based on the
documentation also that the form would not be null that was passed to
execute.
-Ben
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: DynaActionForm question
Posted by Mark Lowe <ma...@talk21.com>.
Nice...
So the attribute attribute lets you override the the attribute name
when the setAttribute method is called, rather than using the default
form name.
Thanks Mark
On 3 Jan 2004, at 14:13, Matthias Wessendorf wrote:
> hi,
>
> attribute:
> Name of the request-scope or session-scope attribute that
> is used to access our ActionForm bean, if it is other than
> the bean's specified "name". Optional if "name" is specified,
> else not valid.
>
> if you have something like this:
>
> <action path="/foo"
> type="com.my.BeanForm"
> attribute="foo"
> name="form2"
> input="/input.jsp"
> scope="request"
> validate="true">
>
> and:
> <form-bean name="form2"
> type="org.apache.struts.validator.DynaValidatorForm">
> <form-property name="property1" type="java.lang.String"/>
> </form-bean>
>
> your FormBean "form" of type:DynaValidatorForm
> is named as "foo"
> request.getAttribute("foo");
> or
> request.getSession().getAttribute("foo");
>
> greetings
> matthias
>
>
> -----Original Message-----
> From: Mark Lowe [mailto:mark.lowe@talk21.com]
> Sent: Saturday, January 03, 2004 2:05 PM
> To: Struts Users Mailing List
> Subject: Re: DynaActionForm question
>
>
> Not sure if its deprecated but i always use
>
> <action path="/foo" name="myForm" ..
>
> rather than attribute which i don't know anything about.
>
> Cheers Mark
>
> On 2 Jan 2004, at 20:44, Sifuentes, Ben wrote:
>
>> I have been trying to do the following:
>> <form-bean
>> name="searchForm"
>>
> type="com.mckesson.eig.actions.search.patient.SearchForm">
>> <form-property name="facilities"
> type="java.util.ArrayList"/>
>> <form-property name="sexes"
>> type="java.util.ArrayList"/>
>> <form-property name="age"
> type="java.lang.String"/>
>> <form-property name="admissionDate"
>> type="java.lang.String"/>
>> <form-property name="admissionDays"
>> type="java.lang.String"/>
>> <form-property name="ageRange"
>> type="java.lang.String"/>
>> <form-property name="dateOfBirth"
>> type="java.lang.String"/>
>> <form-property name="dischargeDate"
>> type="java.lang.String"/>
>> <form-property name="dischargeDays"
>> type="java.lang.String"/>
>> <form-property name="encounterNumber"
>> type="java.lang.String"/>
>> <form-property name="mrn"
> type="java.lang.String"/>
>> <form-property name="ssn"
> type="java.lang.String"/>
>> <form-property name="gpi"
> type="java.lang.String"/>
>> <form-property name="firstName"
>> type="java.lang.String"/>
>> <form-property name="lastName"
>> type="java.lang.String"/>
>> <form-property name="patients"
>> type="java.util.ArrayList"
>> className="com.mckesson.eig.common.struts.NullInitialPropertyConfig"/>
>> <form-property name="selectedSex"
>> type="java.lang.String"/>
>> <form-property name="selectedFacilityCode"
>> type="java.lang.String"/>
>> <form-property name="currentPatientIndex"
>> type="java.lang.Integer"/>
>> <form-property name="selectedEncounters"
>> type="java.util.ArrayList"/>
>> <form-property name="selectedEncounter"
>> type="java.lang.String"/>
>> <form-property name="chartSelectedEncounters"
>> type="java.lang.String[]"/>
>> <form-property name="chartSelectedMrn"
>> type="java.lang.String"/>
>> <form-property name="chartSelectedFacility"
>> type="java.lang.String"/>
>> <form-property name="popupProperties"
>>
> type="com.mckesson.eig.common.presentation.properties.WindowPopupProper
>> ties"
>> />
>> </form-bean>
>>
>> <action
>> path="/remoteParam"
>>
>> type="com.mckesson.eig.actions.RemoteParameterAction">
>> attribute="searchForm"
>> scope="session"
>> validate="false">
>> </action>
>>
>>
>> Based on the following struts documentation this should have
> worked?
>>
>> <action path="/editRegistration"
>>
>> type="org.apache.struts.webapp.example.EditRegistrationAction"
>> attribute="registrationForm"
>> scope="request"
>> validate="false">
>> <forward name="success path="/registration.jsp"/>
>> </action>
>>
>> When the /editRegistration action is invoked, a registrationForm
> is
>> created and added to the request, but its validate method is not
>> called. The
>> default value of the validate attribute is true, so if you do not want
>
>> an
>> action to trigger form validation, you need to remember to add this
>> attribute and set it to false.
>>
>> So now when I print off the session values when the action is
> fired
>> these attributes are the only ones that exists:
>>
>> [02 Jan 2004 13:40:58,699] [RemoteParameterAction] Scope:
> session
>> [02 Jan 2004 13:40:58,699] [RemoteParameterAction] searchForm
> must be
>> null in session
>> [02 Jan 2004 13:40:58,709] [RemoteParameterAction] name:
> SWIM_USER
>> [02 Jan 2004 13:40:58,779] [RemoteParameterAction] name:
>> SWIM_FACILITY
>> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
>> SESSION_MANAGER
>> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
> SWIM_MRN
>> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
>> org.apache.struts.action.LOCALE
>> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] Our Form is
>> null........
>> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] Controller
>> contains Mrn: [032599]
>>
>>
>> I was expecting to see a searchForm in the session based on the
>> documentation also that the form would not be null that was passed to
>> execute.
>>
>>
>> -Ben
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: DynaActionForm question
Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
hi,
attribute:
Name of the request-scope or session-scope attribute that
is used to access our ActionForm bean, if it is other than
the bean's specified "name". Optional if "name" is specified,
else not valid.
if you have something like this:
<action path="/foo"
type="com.my.BeanForm"
attribute="foo"
name="form2"
input="/input.jsp"
scope="request"
validate="true">
and:
<form-bean name="form2"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="property1" type="java.lang.String"/>
</form-bean>
your FormBean "form" of type:DynaValidatorForm
is named as "foo"
request.getAttribute("foo");
or
request.getSession().getAttribute("foo");
greetings
matthias
-----Original Message-----
From: Mark Lowe [mailto:mark.lowe@talk21.com]
Sent: Saturday, January 03, 2004 2:05 PM
To: Struts Users Mailing List
Subject: Re: DynaActionForm question
Not sure if its deprecated but i always use
<action path="/foo" name="myForm" ..
rather than attribute which i don't know anything about.
Cheers Mark
On 2 Jan 2004, at 20:44, Sifuentes, Ben wrote:
> I have been trying to do the following:
> <form-bean
> name="searchForm"
>
type="com.mckesson.eig.actions.search.patient.SearchForm">
> <form-property name="facilities"
type="java.util.ArrayList"/>
> <form-property name="sexes"
> type="java.util.ArrayList"/>
> <form-property name="age"
type="java.lang.String"/>
> <form-property name="admissionDate"
> type="java.lang.String"/>
> <form-property name="admissionDays"
> type="java.lang.String"/>
> <form-property name="ageRange"
> type="java.lang.String"/>
> <form-property name="dateOfBirth"
> type="java.lang.String"/>
> <form-property name="dischargeDate"
> type="java.lang.String"/>
> <form-property name="dischargeDays"
> type="java.lang.String"/>
> <form-property name="encounterNumber"
> type="java.lang.String"/>
> <form-property name="mrn"
type="java.lang.String"/>
> <form-property name="ssn"
type="java.lang.String"/>
> <form-property name="gpi"
type="java.lang.String"/>
> <form-property name="firstName"
> type="java.lang.String"/>
> <form-property name="lastName"
> type="java.lang.String"/>
> <form-property name="patients"
> type="java.util.ArrayList"
> className="com.mckesson.eig.common.struts.NullInitialPropertyConfig"/>
> <form-property name="selectedSex"
> type="java.lang.String"/>
> <form-property name="selectedFacilityCode"
> type="java.lang.String"/>
> <form-property name="currentPatientIndex"
> type="java.lang.Integer"/>
> <form-property name="selectedEncounters"
> type="java.util.ArrayList"/>
> <form-property name="selectedEncounter"
> type="java.lang.String"/>
> <form-property name="chartSelectedEncounters"
> type="java.lang.String[]"/>
> <form-property name="chartSelectedMrn"
> type="java.lang.String"/>
> <form-property name="chartSelectedFacility"
> type="java.lang.String"/>
> <form-property name="popupProperties"
>
type="com.mckesson.eig.common.presentation.properties.WindowPopupProper
> ties"
> />
> </form-bean>
>
> <action
> path="/remoteParam"
>
> type="com.mckesson.eig.actions.RemoteParameterAction">
> attribute="searchForm"
> scope="session"
> validate="false">
> </action>
>
>
> Based on the following struts documentation this should have
worked?
>
> <action path="/editRegistration"
>
> type="org.apache.struts.webapp.example.EditRegistrationAction"
> attribute="registrationForm"
> scope="request"
> validate="false">
> <forward name="success path="/registration.jsp"/>
> </action>
>
> When the /editRegistration action is invoked, a registrationForm
is
> created and added to the request, but its validate method is not
> called. The
> default value of the validate attribute is true, so if you do not want
> an
> action to trigger form validation, you need to remember to add this
> attribute and set it to false.
>
> So now when I print off the session values when the action is
fired
> these attributes are the only ones that exists:
>
> [02 Jan 2004 13:40:58,699] [RemoteParameterAction] Scope:
session
> [02 Jan 2004 13:40:58,699] [RemoteParameterAction] searchForm
must be
> null in session
> [02 Jan 2004 13:40:58,709] [RemoteParameterAction] name:
SWIM_USER
> [02 Jan 2004 13:40:58,779] [RemoteParameterAction] name:
> SWIM_FACILITY
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
> SESSION_MANAGER
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
SWIM_MRN
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
> org.apache.struts.action.LOCALE
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] Our Form is
> null........
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] Controller
> contains Mrn: [032599]
>
>
> I was expecting to see a searchForm in the session based on the
> documentation also that the form would not be null that was passed to
> execute.
>
>
> -Ben
>
>
>
>
> ---------------------------------------------------------------------
> 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
Re: DynaActionForm question
Posted by Mark Lowe <ma...@talk21.com>.
Not sure if its deprecated but i always use
<action path="/foo" name="myForm" ..
rather than attribute which i don't know anything about.
Cheers Mark
On 2 Jan 2004, at 20:44, Sifuentes, Ben wrote:
> I have been trying to do the following:
> <form-bean
> name="searchForm"
> type="com.mckesson.eig.actions.search.patient.SearchForm">
> <form-property name="facilities"
> type="java.util.ArrayList"/>
> <form-property name="sexes"
> type="java.util.ArrayList"/>
> <form-property name="age" type="java.lang.String"/>
> <form-property name="admissionDate"
> type="java.lang.String"/>
> <form-property name="admissionDays"
> type="java.lang.String"/>
> <form-property name="ageRange"
> type="java.lang.String"/>
> <form-property name="dateOfBirth"
> type="java.lang.String"/>
> <form-property name="dischargeDate"
> type="java.lang.String"/>
> <form-property name="dischargeDays"
> type="java.lang.String"/>
> <form-property name="encounterNumber"
> type="java.lang.String"/>
> <form-property name="mrn" type="java.lang.String"/>
> <form-property name="ssn" type="java.lang.String"/>
> <form-property name="gpi" type="java.lang.String"/>
> <form-property name="firstName"
> type="java.lang.String"/>
> <form-property name="lastName"
> type="java.lang.String"/>
> <form-property name="patients"
> type="java.util.ArrayList"
> className="com.mckesson.eig.common.struts.NullInitialPropertyConfig"/>
> <form-property name="selectedSex"
> type="java.lang.String"/>
> <form-property name="selectedFacilityCode"
> type="java.lang.String"/>
> <form-property name="currentPatientIndex"
> type="java.lang.Integer"/>
> <form-property name="selectedEncounters"
> type="java.util.ArrayList"/>
> <form-property name="selectedEncounter"
> type="java.lang.String"/>
> <form-property name="chartSelectedEncounters"
> type="java.lang.String[]"/>
> <form-property name="chartSelectedMrn"
> type="java.lang.String"/>
> <form-property name="chartSelectedFacility"
> type="java.lang.String"/>
> <form-property name="popupProperties"
> type="com.mckesson.eig.common.presentation.properties.WindowPopupProper
> ties"
> />
> </form-bean>
>
> <action
> path="/remoteParam"
>
> type="com.mckesson.eig.actions.RemoteParameterAction">
> attribute="searchForm"
> scope="session"
> validate="false">
> </action>
>
>
> Based on the following struts documentation this should have worked?
>
> <action path="/editRegistration"
>
> type="org.apache.struts.webapp.example.EditRegistrationAction"
> attribute="registrationForm"
> scope="request"
> validate="false">
> <forward name="success path="/registration.jsp"/>
> </action>
>
> When the /editRegistration action is invoked, a registrationForm is
> created and added to the request, but its validate method is not
> called. The
> default value of the validate attribute is true, so if you do not want
> an
> action to trigger form validation, you need to remember to add this
> attribute and set it to false.
>
> So now when I print off the session values when the action is fired
> these attributes are the only ones that exists:
>
> [02 Jan 2004 13:40:58,699] [RemoteParameterAction] Scope: session
> [02 Jan 2004 13:40:58,699] [RemoteParameterAction] searchForm must
> be null in session
> [02 Jan 2004 13:40:58,709] [RemoteParameterAction] name: SWIM_USER
> [02 Jan 2004 13:40:58,779] [RemoteParameterAction] name:
> SWIM_FACILITY
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
> SESSION_MANAGER
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name: SWIM_MRN
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] name:
> org.apache.struts.action.LOCALE
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] Our Form is
> null........
> [02 Jan 2004 13:40:58,789] [RemoteParameterAction] Controller
> contains Mrn: [032599]
>
>
> I was expecting to see a searchForm in the session based on the
> documentation also that the form would not be null that was passed to
> execute.
>
>
> -Ben
>
>
>
>
> ---------------------------------------------------------------------
> 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