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:[EMAIL PROTECTED] 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:
type="com.mckesson.eig.actions.search.patient.SearchForm">I have been trying to do the following: <form-bean name="searchForm"
<form-property name="facilities"type="java.util.ArrayList"/>type="java.lang.String"/><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"<form-property name="ssn"type="java.lang.String"/><form-property name="gpi"type="java.lang.String"/>type="com.mckesson.eig.common.presentation.properties.WindowPopupProper<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"
worked?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 haveis
<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 registrationFormcreated 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
firedan 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 isthese attributes are the only ones that exists:session
[02 Jan 2004 13:40:58,699] [RemoteParameterAction] Scope:[02 Jan 2004 13:40:58,699] [RemoteParameterAction] searchFormmust beSWIM_USERnull in session [02 Jan 2004 13:40:58,709] [RemoteParameterAction] name:SWIM_MRN[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:[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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]