* GSWeb/GSWAjaxRequestHandler.*

new files
    * GSWeb/GNUmakefile
      add GSWAjaxRequestHandler.*, WOAjaxRequestHandler.h
    * GSWeb/GSWApplication+Defaults.*
      add AjaxRequestHanderKey
    * GSWeb/GSWApplication.h
      add +ajaxRequestHandlerKey
      add +setAjaxRequestHandlerKey:
    * GSWeb/GSWApplication.m
      create ajax request handler in registerRequestHandlers
    * GSWeb/GSWComponentRequestHandler.m
      return current class instance in +handler (works in subclasses too..)
    * GSWConstants.*
      added ajax
    * GSWContext.*
      added +shouldNotStorePageInBacktrackCache
    * GSWeb/GSWMessage.*
      added storePageInBacktrackCache
    * GSWeb/GSWRequest.*
      added -isAjaxSubmit, ajaxFormSubmitKey
    * GSWeb/GSWSession.m
    * GSWeb/GSWeb.h
    * GSWeb/GSWWOCompatibility.h
      ajax adjustments
This commit is contained in:
David Wetzel 2017-11-19 13:45:05 -05:00
parent 237ae78d01
commit 2bb828acb7
17 changed files with 260 additions and 113 deletions

View file

@ -4,10 +4,6 @@
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
Date: Jan 1999
$Revision$
$Date$
$Id$
This file is part of the GNUstep Web Library.
@ -198,6 +194,8 @@
@implementation GSWRequest
static NSString * __AJAX_FORM_SUBMIT_KEY = @"AJAX_SUBMIT_BUTTON_NAME";
//--------------------------------------------------------------------
// initWithMethod:uri:httpVersion:headers:content:userInfo:
@ -722,6 +720,10 @@
{
id formValue=nil;
NSArray* formValuesForKey=nil;
if (!key) {
return nil;
}
formValuesForKey=[self formValuesForKey:key];
NSAssert3(!formValuesForKey || [formValuesForKey isKindOfClass:[NSArray class]],@"formValues:%@ ForKey:%@ is not a NSArray it's a %@",
@ -1369,6 +1371,22 @@
};
//--------------------------------------------------------------------
-(BOOL) isAjaxSubmit
{
return ([self formValueForKey:[[self class] ajaxFormSubmitKey]] != nil);
}
+ (NSString*) ajaxFormSubmitKey
{
return (__AJAX_FORM_SUBMIT_KEY == nil) ? @"" : __AJAX_FORM_SUBMIT_KEY;
}
+ (void) setAjaxFormSubmitKey:(NSString*) value
{
ASSIGN(__AJAX_FORM_SUBMIT_KEY,(value == nil) ? @"" : value);
}
// FIXME:check if that is needed for 4.5 compat
-(BOOL)_isUsingWebServer
{