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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
allowWithoutAuthentication
(String className, String methodName) Be default, all web service methods are authenticated.protected void
doPost
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) static String
Return the root of the application back-end source code.static Connection.ConnectionType
static String
static Object
getEnvironment
(String key) Retrieve an application-specific value previously set withputEnvironment
static String
getHost()
static String
static Integer
getPort()
static String
Get the root path of the entire application.static String
getUser()
static boolean
static boolean
Returnstrue
if in development mode.static void
putEnvironment
(String key, Object value) Add an application-specific key / value pair.static void
setApplicationPath
(String path) Set the application path when it is determined outside of Kiss.static void
setConnectionType
(Connection.ConnectionType connectionType) static void
setDatabase
(String databasep) static void
static void
setMaxWorkerThreads
(int maxThreads) static void
setPassword
(String passwordp) static void
setPort
(int portp) static void
setRootPath
(String path) Manually set root path if needed.static void
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods 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()Returnstrue
if in development mode. Returnsfalse
if in production. -
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException - Overrides:
doPost
in 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:
-