Class MainServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.kissweb.restServer.MainServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

@WebServlet(urlPatterns="/rest", asyncSupported=true) public class MainServlet extends javax.servlet.http.HttpServlet
Author: Blake McBride Date: 5/4/18 This is the main entry point for asynchronous server requests used by Kiss.
See Also:
  • Field Details

    • isLinux

      public static boolean isLinux
    • isMacOS

      public static boolean isMacOS
    • isWindows

      public static boolean isWindows
    • isSunOS

      public static boolean isSunOS
    • isHaiku

      public static boolean isHaiku
    • isFreeBSD

      public static boolean isFreeBSD
  • Constructor Details

    • MainServlet

      public MainServlet()
  • Method Details

    • isUnderIDE

      public static boolean isUnderIDE()
      Returns true if in development mode. Returns false if in production.
    • doPost

      protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
      Overrides:
      doPost in class javax.servlet.http.HttpServlet
      Throws:
      IOException
    • getApplicationPath

      public static String getApplicationPath()
      Return the root of the application back-end source code. This takes into account where the source code is.
    • getRootPath

      public static String getRootPath()
      Get the root path of the entire application.
    • setRootPath

      public static void setRootPath(String path)
      Manually set root path if needed. This is needed when Kiss is not used to process the REST services. This rootPath is used by the reporting facility.
      Parameters:
      path -
    • setApplicationPath

      public static void setApplicationPath(String path)
      Set the application path when it is determined outside of Kiss. This is needed when an application is using the Kiss library but not its REST server.
      Parameters:
      path -
    • setConnectionType

      public static void setConnectionType(Connection.ConnectionType connectionType)
    • getConnectionType

      public static Connection.ConnectionType getConnectionType()
    • setHost

      public static void setHost(String hostp)
    • setPort

      public static void setPort(int portp)
    • getHost

      public static String getHost()
    • getPort

      public static Integer getPort()
    • getUser

      public static String getUser()
    • setUser

      public static void setUser(String userp)
    • getPassword

      public static String getPassword()
    • setPassword

      public static void setPassword(String passwordp)
    • getDatabase

      public static String getDatabase()
    • setDatabase

      public static void setDatabase(String databasep)
    • setMaxWorkerThreads

      public static void setMaxWorkerThreads(int maxThreads)
    • hasDatabase

      public static boolean hasDatabase()
    • allowWithoutAuthentication

      public static void allowWithoutAuthentication(String className, String methodName)
      Be default, all web service methods are authenticated. This method is used to declare specific rest service methods that should not be authenticated. This allows specific web service methods to be executed prior to logging in.
      Parameters:
      className -
      methodName -
    • putEnvironment

      public static void putEnvironment(String key, Object value)
      Add an application-specific key / value pair.
      Parameters:
      key -
      value -
      See Also:
    • getEnvironment

      public static Object getEnvironment(String key)
      Retrieve an application-specific value previously set with putEnvironment
      Parameters:
      key -
      Returns:
      See Also: