This was supposed to go to the list but apparently only went to Chuck. I have the page working now.
Begin forwarded message: > From: Roger Perryman <[email protected]> > Date: March 12, 2013 2:24:44 PM EDT > To: Chuck Hill <[email protected]> > Subject: Re: (ERX)WOForm creates a new Session > > I guess what confused me was that a simple form with no action specified and > no form content created the session. I also tried directActionNamed on the > SubmitButton. I suppose being a creature of habit and typically having more > than one submit action, I rarely use the action on the form and rely on the > action bound to the respective submit buttons. In this case, there is only > one submit action so putting the binding on form will work. However, I > discovered that it doesn't use the form binding if you also have a binding on > the submit button. So, the form could be bound to the same action as the > "default" button or it could be bound to a dummy method to prevent the > session from being created. > > On a side note, if you have multiple submit buttons and someone presses Enter > the first submit button in the code is the default button. To override it, I > define a dummy submit button with the same action as the real "default" > submit button and position it offscreen. This make the placement of the > buttons easier. This could be tied in to the above solution. > > Thanks Ramsey and Chuck. > > On Mar 12, 2013, at 1:43 PM, Chuck Hill wrote: > >> Hi Roger, >> >> You need to bind directActionName and have the login form submit to a direct >> action. The action then validates the credentials and returns the page >> after login if valid. This also requires that the login page come from a >> direct action. >> >> Chuck >> >> On 2013-03-12, at 10:33 AM, Roger Perryman wrote: >> >>> I am creating a Login page and I don't want it to create a new Session >>> until after the page is submitted. Loading the Login page creates a new >>> session. Initially, I had a few elements that had session references but I >>> corrected those. I am still getting a session created. I've traced it down >>> to the ERXWOForm tag (It does the same thing with WOForm). Removing the tag >>> stops the session from being created. I don't recall this behavior before. >>> I'm hoping it is a simple setting in the properties file. >>> >>> I am using WOnder 5.8.1. >>> >>> I have stripped it down to the simplest page I can get: >>> >>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> >>> <html xmlns = "http://www.w3.org/1999/xhtml"> >>> <head> >>> <meta http-equiv="Content-Type" content="text/html; >>> charset=UTF-8" /> >>> <title>Login</title> >>> </head> >>> <body> >>> <webobject name="loginForm"> >>> <!-- Form content removed for testing --> >>> </webobject name="loginForm"> >>> </body> >>> </html> >>> >>> >>> loginForm: ERXWOForm >>> { >>> id = "loginForm"; >>> multipleSubmit = true; // I've tried both true and false >>> } >>> >>> I believe I have done all of the requisite steps: >>> >>> >>> In Application.java: >>> >>> public Application() >>> { >>> super(); >>> setDefaultRequestHandler( requestHandlerForKey( >>> directActionRequestHandlerKey() ) ); >>> } >>> >>> >>> In DirectAction.java: >>> >>> public WOActionResults defaultAction() >>> { >>> return pageWithName( Login.class ); >>> } >>> >>> In Session.java: (not required but helpful) >>> >>> public Session() >>> { >>> super(); >>> log.info( "Session Created: " + sessionID()); >>> } >>> >>> >>> _______________________________________________ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list ([email protected]) >>> Help/Unsubscribe/Update your Subscription: >>> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net >>> >>> This email sent to [email protected] >> >> -- >> Chuck Hill >> Executive Managing Partner, VP Development and Technical Services >> >> Practical WebObjects - for developers who want to increase their overall >> knowledge of WebObjects or who are trying to solve specific problems. >> http://www.global-village.net/gvc/practical_webobjects >> >> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest >> Growing Companies in B.C! >> Global Village Consulting ranks 76th in 24th annual PROFIT 200 ranking of >> Canada’s Fastest-Growing Companies by PROFIT Magazine! >> >> >> >> >> >> >> >> >> >> >> >> >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
