Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014-2015 Philip Helger (www.helger.com) 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 http://www.apache.org/licenses/LICENSE-2.0 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.decl;
 
 import java.util.Map;
 
 
Default AjaxFunction implementation assuming that the Ajax servlet is listening on "/ajax/"

Author(s):
Philip Helger
 
 {
   public DefaultAjaxFunctionDeclaration (@Nonnull @Nonempty final String sFunctionName,
                                          @Nonnull final IAjaxExecutor aExecutor)
   {
     super (sFunctionNameaExecutor);
   }
 
   public DefaultAjaxFunctionDeclaration (@Nonnull @Nonempty final String sFunctionName,
                                          @Nonnull final Class <? extends IAjaxExecutoraExecutorClass)
   {
     super (sFunctionNameaExecutorClass);
   }
 
   public DefaultAjaxFunctionDeclaration (@Nonnull @Nonempty final String sFunctionName,
                                          @Nonnull final IFactory <? extends IAjaxExecutoraExecutorFactory)
   {
     super (sFunctionNameaExecutorFactory);
   }

  

Returns:
The path to the AJAX servlet. Must start with a slash and end with a slash! Defaults to /ajax/
 
   @Nonnull
   @Nonempty
   protected String getAjaxServletPath ()
   {
     return "/ajax/";
   }
 
   @Nonnull
   @Nonempty
   public final String getPathWithoutContext ()
   {
     return getAjaxServletPath () + getName ();
   }
 
   @Nonnull
   public String getInvocationURI (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope)
   {
     return LinkUtils.getURIWithContext (aRequestScopegetPathWithoutContext ());
   }
 
   @Nonnull
   @Nonempty
   public String getInvocationURI (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
                                   @Nullable final Map <StringStringaParams)
   {
     if (ContainerHelper.isEmpty (aParams))
     {
       // No need to convert to SimpleURL and back
       return getInvocationURI (aRequestScope);
     }
 
     return getInvocationURL (aRequestScopeaParams).getAsString ();
   }
 
  {
    return getInvocationURL (aRequestScope, (Map <StringString>) null);
  }
                                      @Nullable final Map <StringStringaParams)
  {
    return LinkUtils.getURLWithContext (aRequestScopegetPathWithoutContext (), aParams);
  }
New to GrepCode? Check out our FAQ X