public abstract class ServletCall extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
parameters
The parameters of the URL.
Result of the parsing of the query string : "?a=b&c=d&..." |
| Constructor and Description |
|---|
ServletCall(HttpServletRequest request,
HttpServletResponse response)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
countParameters()
Count the number of parameters passed in the URL
|
Object |
deserialize(byte[] bytes) |
abstract void |
doDelete()
Entry point for DELETE
|
abstract void |
doGet()
Entry point for GET and SEARCH
|
abstract void |
doPost()
Entry point for CREATE
|
abstract void |
doPut()
Entry point for UPDATE
|
protected void |
error(String message,
int errorCode) |
List<byte[]> |
getBinaryParameters() |
HttpSession |
getHttpSession()
Get the current call's HttpSession
|
String |
getInputStream()
Read the input stream and set it in a String
|
String |
getParameter(String name)
Get a parameter first value by its name
|
String |
getParameter(String name,
String defaultValue)
Get a parameter first value by its name
|
List<String> |
getParameterAsList(String name)
Get a parameter values by its name
|
List<String> |
getParameterAsList(String name,
String defaultValue)
Get a parameter values by its name
|
String |
getQueryString() |
String |
getRequestURL()
Reconstruct the URL the client used to make the request.
|
protected void |
head(String name,
String value)
Write into the output header.
|
protected void |
output(File file)
Output a file
|
protected void |
output(InputStream stream)
Output a stream as a file
|
protected void |
output(InputStream stream,
String filename)
Output a stream as a file
|
protected void |
output(Object object)
Write into the output
|
protected void |
output(String string)
Write into the output
|
byte[] |
serialize(Object obj) |
public ServletCall(HttpServletRequest request,
HttpServletResponse response)
throws org.apache.commons.fileupload.FileUploadException,
IOException
request - The request made to access this servletCall.response - The response to return.IOExceptionorg.apache.commons.fileupload.FileUploadExceptionpublic List<byte[]> getBinaryParameters()
public byte[] serialize(Object obj) throws IOException
IOExceptionpublic Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic HttpSession getHttpSession()
public String getQueryString()
javax.servlet.http.HttpServletRequest#getQueryString()public final String getRequestURL()
public final String getInputStream()
public final int countParameters()
public final List<String> getParameterAsList(String name)
name - The name of the parameter (case sensitive)public final List<String> getParameterAsList(String name, String defaultValue)
name - The name of the parameter (case sensitive)defaultValue - The value to return if the parameter isn't definepublic final String getParameter(String name)
name - The name of the parameter (case sensitive)public final String getParameter(String name, String defaultValue)
name - The name of the parameter (case sensitive)defaultValue - The value to return if the parameter isn't defineprotected final void head(String name, String value)
name - The name of the header to write.value - The value of the header to write.protected final void output(File file)
file - The file to outputprotected void output(InputStream stream, String filename)
stream - The stream to outputfilename - The name of the file to retrieve with the stream.protected void output(InputStream stream)
stream - The stream to outputprotected void error(String message, int errorCode)
protected final void output(String string)
string - The string to outputprotected final void output(Object object)
object - An object that will be transform into JSonpublic abstract void doGet()
public abstract void doPost()
public abstract void doPut()
public abstract void doDelete()
Copyright © 2015 Bonitasoft S.A.. All rights reserved.