Package org.kissweb.restServer
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidallowWithoutAuthentication(String className, String methodName) Be default, all web service methods are authenticated.protected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) static StringReturn the root of the application back-end source code.static Connection.ConnectionTypestatic Stringstatic ObjectgetEnvironment(String key) Retrieve an application-specific value previously set withputEnvironmentstatic StringgetHost()static Stringstatic IntegergetPort()static StringGet the root path of the entire application.static StringgetUser()static booleanstatic booleanReturnstrueif in development mode.static voidputEnvironment(String key, Object value) Add an application-specific key / value pair.static voidsetApplicationPath(String path) Set the application path when it is determined outside of Kiss.static voidsetConnectionType(Connection.ConnectionType connectionType) static voidsetDatabase(String databasep) static voidstatic voidsetMaxWorkerThreads(int maxThreads) static voidsetPassword(String passwordp) static voidsetPort(int portp) static voidsetRootPath(String path) Manually set root path if needed.static voidMethods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceMethods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
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()Returnstrueif in development mode. Returnsfalseif in production. -
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException - Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
IOException
-
getApplicationPath
Return the root of the application back-end source code. This takes into account where the source code is. -
getRootPath
Get the root path of the entire application. -
setRootPath
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
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
-
getConnectionType
-
setHost
-
setPort
public static void setPort(int portp) -
getHost
-
getPort
-
getUser
-
setUser
-
getPassword
-
setPassword
-
getDatabase
-
setDatabase
-
setMaxWorkerThreads
public static void setMaxWorkerThreads(int maxThreads) -
hasDatabase
public static boolean hasDatabase() -
allowWithoutAuthentication
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
Add an application-specific key / value pair.- Parameters:
key-value-- See Also:
-
getEnvironment
Retrieve an application-specific value previously set withputEnvironment- Parameters:
key-- Returns:
- See Also:
-