public abstract class Controller extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.eclipse.jetty.server.Request |
baseRequest
original base request
|
protected ServerConfig |
config
global server configuration
|
protected GlobalResource |
globalResource
global resource pool
|
protected PrintWriter |
output
output
|
protected javax.servlet.http.HttpServletRequest |
request
http servlet request
|
protected javax.servlet.http.HttpServletResponse |
response
http servlet response
|
protected UriEntry |
uri
request UriEntry
|
| Constructor and Description |
|---|
Controller(ServerConfig config,
GlobalResource globalResource,
UriEntry uriEntry,
org.eclipse.jetty.server.Request baseRequest,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
contruct method
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBoolean(String name)
get a boolean argument
|
boolean |
getBoolean(String name,
boolean val) |
double |
getDouble(String name)
get a double argument
|
double |
getDouble(String name,
double val) |
String |
getEncodeString(String name) |
float |
getFloat(String name)
get a float arguments
|
float |
getFloat(String name,
float val) |
int |
getInt(String name)
get a integer arguments
|
int |
getInt(String name,
int val) |
long |
getLong(String name)
get a long argument
|
long |
getLong(String name,
long val) |
String |
getString(String name)
get a String argument,
encoding will be check and Re-encode maybe.
|
void |
redirect(String path)
redirect to the specifield controller/method
|
protected void |
run(String method)
handle the current request
|
protected ServerConfig config
protected GlobalResource globalResource
protected org.eclipse.jetty.server.Request baseRequest
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
protected PrintWriter output
protected UriEntry uri
public Controller(ServerConfig config, GlobalResource globalResource, UriEntry uriEntry, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
config - resourcePool - uriEntry - baseRequest - request - response - IOExceptionprotected void run(String method) throws IOException
method - IOExceptionpublic String getString(String name)
name - public int getInt(String name)
name - public int getInt(String name, int val)
public float getFloat(String name)
name - public float getFloat(String name, float val)
public long getLong(String name)
name - public long getLong(String name, long val)
public double getDouble(String name)
name - public double getDouble(String name, double val)
public boolean getBoolean(String name)
name - public boolean getBoolean(String name, boolean val)
public void redirect(String path) throws IOException
pathresponse - IOExceptionCopyright © 2016. All Rights Reserved.