Let me make it clear.. I have a jsp file called OrderSummary.jsp which has a link called "EDIT", which should take me to EditShipping.jsp file. User first enters his billing and shipping information in a session and finally comes to a order summary page from there he can go back to the EditShipping.jsp page by clicking on the link . So when i click on the link , the application should take me back to shipping page with all the fields populated. But my shipping page fields are all empty. I have stored the shipping information in session . But in EditShipping.jsp i do not use any of the session attributes to display the values. Go over my edit shipping.jsp file and let me know i fi am missing something.
-----Original Message----- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Monday, August 02, 2004 6:58 PM To: Struts Users Mailing List Subject: RE: Data not being populated on edit in my jsp file... > -----Original Message----- > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED] > Sent: Monday, August 02, 2004 2:29 PM > To: Struts Users Mailing List > Subject: Data not being populated on edit in my jsp file... > > > I have a jsp fle which has a html link to EditShipping.jsp file. > All the attributes in EditShipping.jsp should be populated, > but its not > happening. > CAn anyone help me out... Let me see if I understand: You have a jsp file (call it first.jsp) and have <html:link href="/EditShipping.jsp"/> or <a href="/EditShipping.jsp"/> or something the renders an <a href to the EditShipping page. If that's it.. then why would you expect any kind of communication between pages with a link? You would either have to add in the parameters, or use a <html:form tag to post the data in the first page. > > below is my EditShipping.jsp file...Struts config file..and > OrderSummary.jsp on which the hyperlink is displayed. EditShipping.jsp--- > ===================================================== > <html:form action="/editShipping"> > <div> > <bean:message key="prompt.FirstName"/> > <html:text property="firstName" size="50"/><br> > > <bean:message key="prompt.LastName"/> > <html:text property="lastName" size="50"/><br> > > <bean:message key="prompt.StreetAddress"/> > <html:text property="address1" size="50"/><br> > > <bean:message key="prompt.Address2"/> > <html:text property="address2" size="50"/><br> > > <bean:message key="prompt.City"/> > <html:text property="city" size="50"/><br> > > <bean:message key="prompt.State"/> > <html:select property="state"> > <html:option value="NY">New York</html:option> > <html:option value="NH">New Hampshire</html:option> > <html:option value="NJ">New Jersey</html:option> > </html:select> > <br> > <bean:message key="prompt.Country"/> > <html:select property="country"> > <html:option value="US">UNITED STATES OF > AMERICA</html:option> > </html:select> > <br> > > <bean:message key="prompt.Zip"/> > <html:text property="zip" size="50"/><br> > > <bean:message key="prompt.PhoneNumber"/> > <html:text property="phone" size="50"/><br> > </div> > ============================================================== > Sruts Config.xml > ======================================= > <action > path="/checkCustomer" > type="com.ecommerce.action.CheckCustomerAction" > name="CheckCustomerForm" > scope="session" > input="/CheckCustomer.jsp"> > <forward name="new" path="/EditShipping.jsp" /> > <forward name="returning" path="/OrderSummary.jsp" /> > </action> > > <action > path="/editShipping" > type="com.ecommerce.action.EditShippingAction" > name="ShippingForm" > scope="session" > input="/EditShipping.jsp"> > <forward name="success" path="/ShippingMethod.jsp" /> > <forward name="failure" path="/EditShipping.jsp" /> > </action> > ===================================================== > OrderSummary.jsp --- > > <html:link page="/editShipping.do"> > <bean:message key="edit"/> > </html:link> > ========================================================== > > -----Original Message----- > From: Research labs [mailto:[EMAIL PROTECTED] > Sent: Monday, August 02, 2004 5:17 PM > To: Struts Users Mailing List > Subject: Re: DaTASOURCE CREATION AT USER LOGIN TIME...Newbie > > > Craig, > > Thanks a lot. All points taken. In the light of what > you and Jim have said, I will re examine my plan of > action > > I found out about you in one of my books "Struts in > Action" by Ted Husted et al. If I may, I would like > to keep this first email from you as some sort of > autograph. > > Ola. > > > --- Craig McClanahan <[EMAIL PROTECTED]> wrote: > > On Mon, 2 Aug 2004 21:23:05 +0100 (BST), Research > > labs > > <[EMAIL PROTECTED]> wrote: > > > Jim, > > > > > > Thanks for your response. > > > I want each user to login to the database(MySQL), > > via > > > a JSP. Once logged in, I want them to use their > > > database username (specified at log in time) for > > > communicating with the database throught their > > > session. To put it another way, if 4 users are > > > currently logged in (via a JSP etc.), When I query > > the > > > data dictionary of the database, I want their > > names to > > > come up. At any point in time, I want to be able > > to > > > find out, who is logged in, this is why I do not > > want > > > everyone to log in with the same username and > > password > > > e.g. ola/ola-hardcoded in the Struts config's > > > data-source. > > > > > > > Do you care about finding out who is logged in to > > your *application*, > > or who is logged in to the *database*? Those can > > easily be made > > separate questions, and in most cases should be > > separate. > > > > > I do not mind using any datasource so long as I > > can > > > achieve my objective. > > > > > > > The <data-source> element in struts-config.xml, like > > using most JNDI > > provided data sources, will not address your need. > > That is because > > they create application wide pools for shared > > connections. > > > > Doing what you want to do, however, will also be > > giving up on the key > > advantage of using a data source in the first place > > -- sharing a small > > number of database connections between multiple > > users. By definition, > > if you are using per-user logins to the database, > > such connections > > cannot be shared. That can be problematic for the > > scalability of your > > app, because it will require more database resources > > to be allocated > > than would otherwse be necessary. Plus, you'll > > likely run into limits > > on how many individual database connections can be > > opened before you'd > > ever run out of capacity in your web server to > > support simultaneous > > users. > > > > If all you care is logins to an application, here's > > a couple of easy > > ways to do that while still sharing database > > connections: > > > > * At login time, write into some table someplace a > > row for the logged in user, > > and make sure you clean it up when they log out or > > when the session > > expires. To see who is logged in, run database > > queries against > > this table. > > > > * Store some in-memory data structure (perhaps as an > > application scope > > attribute), and have the login/logout logic add > > and remove entries from > > this data structure. To see who is logged in, set > > up a Struts action or > > something that will go through the data structure > > and list all the logged > > on users. > > > > If you still really want per-user database logins, > > then give up on the > > idea of using any sort of data source -- it won't > > buy you anything. > > Instead, create a standalone JDBC connection at > > login time, and store > > it in session scope somewhere. But I would suggest > > you consider the > > disadvantages of such an approach before using it. > > > > > Thanks. > > > Ola. > > > > > > > Craig > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > ___________________________________________________________ALL > -NEW Yahoo! > Messenger - all new features - even more fun! http://uk.messenger.yahoo.com --------------------------------------------------------------------- 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]