public class WebRequest
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.io.OutputStream |
outStream |
HttpServletRequest |
request |
java.lang.String |
requestURL |
HttpServletResponse |
response |
HttpSession |
session |
java.io.Writer |
w |
| Constructor and Description |
|---|
WebRequest(HttpServletRequest _req,
HttpServletResponse _resp) |
WebRequest(HttpServletRequest _req,
HttpServletResponse _resp,
java.io.Writer aw)
This constructor is used within a JSP file where the Writer has already been grabbed from the
Response object which only allows the writer to be gotten once.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
appBaseUrl()
This is the base URL for the application, which means it has
the protocol, server, port, and application name in the path.
|
java.lang.String |
consumePathToken() |
static WebRequest |
findOrCreate(HttpServletRequest _req,
HttpServletResponse _resp,
java.io.Writer aw)
This factory method is used within a JSP file where the Writer has already been grabbed from the
Response object which only allows the writer to be gotten once.
|
java.lang.String |
getAuthUserId()
During the course of this session, if setAuthUserId has been called, then this
will return the value that was given at that time.
|
java.lang.String |
getConfigSetting(java.lang.String name) |
JSONObject |
getPostedObject() |
java.lang.String |
getSessionProperty(java.lang.String propName) |
boolean |
isDelete() |
boolean |
isGet() |
boolean |
isOptions() |
boolean |
isPost() |
boolean |
isPut() |
boolean |
pathFinished() |
void |
setAuthUserId(java.lang.String newId)
You can implement your own login methods
and this simply records the result in the current session.
|
void |
setSessionProperty(java.lang.String propName,
java.lang.String newVal) |
void |
storeContentsToFile(java.io.File destination)
Reads the uploaded PUT body, and stores it to the specified
file (using a temp name, and deleting whatever file might
have been there before.)
|
void |
streamAttachment(java.lang.String attachmentName,
java.io.InputStream content) |
static void |
streamException(java.lang.Throwable e,
HttpServletRequest request,
HttpServletResponse response,
java.io.Writer w) |
void |
streamException(java.lang.Throwable e,
SessionManager score) |
void |
streamFile(java.io.File fullPath) |
void |
streamJSON(JSONObject jo) |
public HttpServletRequest request
public HttpServletResponse response
public HttpSession session
public java.io.Writer w
public java.io.OutputStream outStream
public java.lang.String requestURL
public WebRequest(HttpServletRequest _req,
HttpServletResponse _resp)
throws java.lang.Exception
java.lang.Exceptionpublic WebRequest(HttpServletRequest _req,
HttpServletResponse _resp,
java.io.Writer aw)
throws java.lang.Exception
java.lang.Exceptionpublic static WebRequest findOrCreate(HttpServletRequest _req, HttpServletResponse _resp, java.io.Writer aw) throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String appBaseUrl()
public java.lang.String consumePathToken()
public boolean pathFinished()
public boolean isGet()
public boolean isPost()
public boolean isPut()
public boolean isDelete()
public boolean isOptions()
public JSONObject getPostedObject() throws java.lang.Exception
java.lang.Exceptionpublic void storeContentsToFile(java.io.File destination)
throws java.lang.Exception
java.lang.Exceptionpublic void streamJSON(JSONObject jo) throws java.lang.Exception
java.lang.Exceptionpublic void streamException(java.lang.Throwable e,
SessionManager score)
public static void streamException(java.lang.Throwable e,
HttpServletRequest request,
HttpServletResponse response,
java.io.Writer w)
public void streamFile(java.io.File fullPath)
throws java.lang.Exception
java.lang.Exceptionpublic void streamAttachment(java.lang.String attachmentName,
java.io.InputStream content)
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String getAuthUserId()
public void setAuthUserId(java.lang.String newId)
public java.lang.String getSessionProperty(java.lang.String propName)
public void setSessionProperty(java.lang.String propName,
java.lang.String newVal)
public java.lang.String getConfigSetting(java.lang.String name)
throws java.lang.Exception
java.lang.Exception