Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AddStartHandler - how to bypass to an IWForm without creating a Session
#1
I use the code from >Alexandre MAchado> Embrace the backbutton for my program with special Login-funtion, so everyone must take the login-credentials - even if he uses the back/Forwardbutton or just types in the hole URL.

But I want to make one IWForm accessable to everyone - so bypassed by the AddStartHandler?

Quote:The first one THandlers.AddStartHandler(), creates a new content handler for this form and sets it as the application’s Start handler, i.e. every new request that doesn’t have an associated session will be redirected to this handler. In practice, it means that every new request that creates a new session will be redirected to the MainForm, regardless of the URL. This feature is ideal to be used in applications that require a login, for instance.

How do I make an expecption to the function of "AddStartHandler"?
Code:
// this doesnt work???
  THandlers.Add('weather_info2', TContentForm.Create(TIWForm5));


Here is the code in the main-client-form.

Code:
initialization
  TIWForm1.SetAsMainForm;

  // SetURL creates a content handler for this form and set's the URL for it according to the parameters
  // In this case, I want the URL to be http://<domain>/MainForm:
  TIWForm1.SetURL('', 'MainForm');

  // I'm also creating 2 content handlers that I want to redirect to this same form:
  // The StartHandler (i.e. it will catch all requests that create a new session
  THandlers.AddStartHandler('', 'MainForm', TContentForm.Create(TIWForm1));

  // And the root handler which will catch requests to the root address of your app
  THandlers.AddRootHandler('', 'MainForm', TContentForm.Create(TIWForm1));

  // this doesnt work???
  THandlers.Add('weather_info2', TContentForm.Create(TIWForm5));

end.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)