com.dyuproject.web.rest
Class WebContext
java.lang.Object
com.dyuproject.web.rest.WebContext
- Direct Known Subclasses:
- RESTControllerContext, RESTServiceContext
public abstract class WebContext
- extends Object
The REST web application context.
- Author:
- David Yu
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DISPATCH_ATTR
public static final String DISPATCH_ATTR
- See Also:
- Constant Field Values
PATH_SUFFIX_ATTR
public static final String PATH_SUFFIX_ATTR
- See Also:
- Constant Field Values
DEFAULT_MIME_LOCATION
public static final String DEFAULT_MIME_LOCATION
- See Also:
- Constant Field Values
DEFAULT_ENV_LOCATION
public static final String DEFAULT_ENV_LOCATION
- See Also:
- Constant Field Values
SESSION_ENABLED
public static final String SESSION_ENABLED
- See Also:
- Constant Field Values
PATHINFO_ARRAY_ATTR
public static final String PATHINFO_ARRAY_ATTR
- See Also:
- Constant Field Values
PATHINFO_INDEX_ATTR
public static final String PATHINFO_INDEX_ATTR
- See Also:
- Constant Field Values
WebContext
public WebContext()
getCurrentRequestContext
public static RequestContext getCurrentRequestContext()
getRequestContext
public RequestContext getRequestContext()
getCurrentSession
public static CookieSession getCurrentSession()
isInitialized
public boolean isInitialized()
getSession
public CookieSession getSession(HttpServletRequest request,
boolean create)
getSession
public CookieSession getSession(HttpServletRequest request)
persistSession
public boolean persistSession(CookieSession session,
HttpServletRequest request,
HttpServletResponse response)
throws IOException
- Throws:
IOException
invalidateSession
public boolean invalidateSession(HttpServletResponse response)
throws IOException
- Throws:
IOException
isSessionEnabled
public boolean isSessionEnabled()
getServletContext
public ServletContext getServletContext()
getJSPDispatcher
public JSPDispatcher getJSPDispatcher()
getDefaultDispatcher
public DefaultDispatcher getDefaultDispatcher()
setViewDispatchers
public void setViewDispatchers(Map<String,ViewDispatcher> dispatchers)
addViewDispatcher
public void addViewDispatcher(String mime,
ViewDispatcher dispatcher)
getViewDispatcher
public ViewDispatcher getViewDispatcher(String name)
setMime
public void setMime(Properties mimes)
setMime
public void setMime(InputStream stream)
setMime
public void setMime(File location)
throws IOException
- Throws:
IOException
setMime
public void setMime(URL location)
throws IOException
- Throws:
IOException
isMimeSupported
public boolean isMimeSupported(String mime)
setEnv
public void setEnv(Properties env)
setEnv
public void setEnv(InputStream stream)
setEnv
public void setEnv(File location)
throws IOException
- Throws:
IOException
setEnv
public void setEnv(URL location)
throws IOException
- Throws:
IOException
setAttributes
public void setAttributes(Map<String,Object> attributes)
addAttribute
public void addAttribute(String name,
Object value)
getAttribute
public Object getAttribute(String name)
getProperty
public String getProperty(String name)
newObjectInstance
protected Object newObjectInstance(String className)
throws Exception
- Throws:
Exception
service
public void service(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
- Throws:
ServletException
IOException
preConfigure
protected abstract void preConfigure(ServletConfig config)
throws Exception
- Throws:
Exception
init
protected abstract void init()
destroy
protected abstract void destroy()
handleRoot
protected abstract void handleRoot(RequestContext requestContext)
throws ServletException,
IOException
- Throws:
ServletException
IOException
handlePath
protected abstract void handlePath(RequestContext requestContext)
throws ServletException,
IOException
- Throws:
ServletException
IOException
Copyright © 2013. All Rights Reserved.