Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger ( philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package com.helger.webbasics.ajax.executor;
Provides a common implementation of the com.helger.webbasics.ajax.IAjaxExecutor interface for as easy reuse as possible.

Philip Helger
 public abstract class AbstractAjaxExecutor implements IAjaxExecutor
The name of the request parameter used by jQuery to indicate "no cache". Use this constant for parameter filtering.
   public static final String REQUEST_PARAM_JQUERY_NO_CACHE = "_";
   public AbstractAjaxExecutor ()
   public void initExecution (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope)
     // By default do nothing
   public void registerExternalResources ()
     // empty default implementation
   protected void modifyRequestParamMap (@Nonnull final MapBasedAttributeContainer aParams)
     // Remove the jQuery timestamp parameter

This method must be overridden by every handler

aRequestScope The current request scope. Never null.
the result object. May not be null
   protected abstract IAjaxResponse mainHandleRequest (@Nonnull IRequestWebScopeWithoutResponse aRequestScopethrows Exception;
   public final IAjaxResponse handleRequest (@Nonnull final IRequestWebScopeWithoutResponse aRequestScopethrows Exception
     // Main invocation
     final IAjaxResponse aResult = mainHandleRequest (aRequestScope);
     if (aResult == null)
       throw new IllegalStateException ("Invocation of " +
                                        CGStringHelper.getClassLocalName (getClass ()) +
                                        " returned null response!");
     // Return invocation result
     return aResult;
   public String toString ()
     return new ToStringGenerator (this).toString ();
New to GrepCode? Check out our FAQ X