Yep, I have session scope in both action mappings I have attached my struts-config along with this mail.
btw in my jsp i have form bean saying JSP 1 <html:form action="/ominterfaceinfo.do" focus="sOMName" onsubmit="return validateWIGAdminWizardForm(this);"> JSP 2 <html:form action="/translator.do" onsubmit="return validateWIGAdminWizardForm(this);"> now, when I call jsp1 the bean is getting created but when I move to jsp 2 , again new bean is created. And thatz the problem area. Thanks Chetan ----- Original Message ----- From: "du Plessis, Corneil C" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, February 26, 2003 12:05 PM Subject: RE: [Q] BEAN SCOPE > Did you put scope=session on both action mappings? > > -----Original Message----- > From: Chetan Sahasrabudhe [mailto:[EMAIL PROTECTED] > Sent: 26 February, 2003 08:31 > To: Struts Users Mailing List > Subject: [Q] BEAN SCOPE > > > Hi, > I am trying to figure out what can be the problem in my struts-config > from yday, > will anyone tell me what can be the problem if, I am putting scope="session" > in my action-mapping > and trying to access same formbean from two different actions. > > Once the bean is created, it should be there for the session, and when I > move to next jsp and call another action it should use same bean rather than > creating a new one. > > I know itz creating new bean, coz I have put default constructor in my > formbean and am printing System.out.printing() through constructor. > > > Regards > Chetan > _______________________________ > | > | The trouble with being punctual > | is that nobody's there to appreciate it. > | > | > |_______________________________ > > > > > > ______________________________________________ > > Disclaimer and confidentiality note > > > Everything in this e-mail and any attachments relating to the official business of > Standard Bank Group Limited is proprietary to the company. It is confidential, legally > privileged and protected by law. Standard Bank does not own and endorse any other content. > Views and opinions are those of the sender unless clearly stated as being that of Standard Bank. > > The person addressed in the e-mail is the sole authorised recipient. Please notify the sender > immediately if it has unintentionally reached you and do not read, disclose or use the content > in any way. > > Standard Bank can not assure that the integrity of this communication has been maintained nor > that it is free of errors, virus, interception or interference. > > ______________________________________________ >
<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"> <!-- This is the Struts configuration file for the WIGAdmin application, using the proposed new syntax. NOTE: You would only flesh out the details in the "form-bean" declarations if you had a generator tool that used them to create the corresponding Java classes for you. Otherwise, you would need only the "form-bean" element itself, with the corresponding "name" and "type" attributes. --> <struts-config> <!-- ========== Data Source Configuration =============================== --> <!-- <data-sources> <data-source> <set-property property="autoCommit" value="false"/> <set-property property="description" value="Example Data Source Configuration"/> <set-property property="driverClass" value="org.postgresql.Driver"/> <set-property property="maxCount" value="4"/> <set-property property="minCount" value="2"/> <set-property property="password" value="mypassword"/> <set-property property="url" value="jdbc:postgresql://localhost/mydatabase"/> <set-property property="user" value="myusername"/> </data-source> </data-sources> --> <!-- ========== Form Bean Definitions =================================== --> <form-beans> <form-bean name="wigadminwizardform" type="wigadmin.struts.forms.WIGAdminWizardForm"> <form-property name="nOMId" type="int"/> <form-property name="sOMName" type="java.lang.String"/> <form-property name="sTransactionType" type="java.lang.String"/> <form-property name="sServerName" type="java.lang.String"/> <form-property name="sPortNumber" type="java.lang.String"/> <form-property name="chkExistingOMName" type="boolean"/> <form-property name="sExistingOMName" type="java.lang.String"/> <form-property name="alExistingOMName" type="java.util.Collection"/> <form-property name="sTranslatorType" type="java.lang.String"/> <form-property name="sBatchFileName" type="java.lang.String"/> <form-property name="sWisorMainBatchFileName" type="java.lang.String"/> <form-property name="colTranslatorType" type="java.util.Collection"/> </form-bean> </form-beans> <!-- ========== Global Forward Definitions ============================== --> <global-forwards> <!-- Adding global forward definition for OMInterfaceInfo jsp --> <forward name="ominterfaceinfo" path="/ominterfaceinfo.jsp"/> <forward name="success" path="wigadmin.html"/> <forward name="tpinterfaceinfo" path="TPInterfaceInfo.html"/> <forward name="translator" path="translator.jsp"/> </global-forwards> <!-- ========== Action Mapping Definitions ============================== --> <action-mappings> <!-- adding aciton mapping information, this will deligate request to OMInterfaceInfoAction class for WIGAdminWizardForm bean --> <!-- Order Manager Interface Information --> <action attribute="wigadminwizardform" path="/ominterfaceinfo" type="wigadmin.struts.action.OMInterfaceInfoAction" name="wigadminwizardform" scope="session" input="ominterfaceinfo" validate="true"> </action> <!-- Translator Information --> <action attribute="wigadminwizardform" path="/translator" type="wigadmin.struts.action.TranslatorAction" name="wigadminwizardform" scope="session" input="translator" validate="true"> </action> </action-mappings> <!-- ========== Controller Configuration ================================ --> <controller> <!-- The "input" parameter on "action" elements is the name of a local or global "forward" rather than a module-relative path --> <set-property property="inputForward" value="true"/> <set-property property="locale" value="true"/> </controller> <!-- ========== Message Resources Definitions =========================== --> <message-resources parameter="wigadmin.struts.properties.ApplicationResources"> </message-resources> <!-- ========== Plug Ins Configuration ================================== --> <plug-in className="org.apache.struts.validator.ValidatorPlugIn"> <set-property property="pathnames" value="/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml"/> </plug-in> </struts-config>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]