public final class WebScope extends Object implements Scope
| Constructor and Description |
|---|
WebScope(HttpBridletContext ctx)
The only constructor for this object, the HTTP bridlet context for the
request mus be provided.
|
| Modifier and Type | Method and Description |
|---|---|
HttpCookie |
addCookie(String name,
String value)
Adds a cookie to the HTTP response.
|
String |
getAccept()
The Accept header sent by the client.
|
String |
getContentType()
The mime/type sent by the client for this request, this method will get
the Content-Type HTTP header.
|
HttpCookie |
getCookie(String name)
Gets the specified HTTP cookie.
|
Map<String,HttpCookie> |
getCookies()
Gets a map with all the cookies sent to the server by the client.
|
String[] |
getCookiesNames()
Gets all the cookies names available in this request.
|
HttpReqParam |
getGetParameter(String parameter)
Gets the specific "GET" parameter from the parameters map.
|
Map<String,HttpReqParam> |
getGetParameters()
Gets the "GET" parameters that where sent by the client in the query
string of the request.
|
String[] |
getGetParametersNames()
Gets all the "GET" parameters names for this request if any.
|
String |
getHeader(String header)
Gets the value of the given header.
|
String |
getHost()
The host of the server the client made the HTTP request to
|
IocContext<WebScope> |
getIocContext()
The IoC context for this web request.
|
String |
getMethod()
The HTTP method used to made the request.
|
String |
getOrigPath()
The requested path asked by the client.
|
String |
getPath()
The current requested path, this method finds a ReqPathRef instance if
any and retrieve the path specified there, if no instance is available it
returns the requested path.
|
HttpReqParam |
getPostParameter(String parameter)
Gets the specific post parameter from the parameters map.
|
Map<String,HttpReqParam> |
getPostParameters()
Gets a unmodificable map to the post parameters sent by the client.
|
String[] |
getPostParametersNames()
Gets all the post parameters names for this request if any.
|
String |
getProtocol()
The protocol used to made the request
|
WebSession |
getSession()
Gets the current WebSession for this HTTP request.
|
String |
getStateValue(String name) |
String |
getUserAgent()
The UserAgent heather from the HTTP request if any.
|
boolean |
isDelete()
When ever this request is http method is "DELETE".
|
boolean |
isGet()
When ever this request is HTTP method is "GET".
|
boolean |
isPatch()
When ever this request is HTTP method is "PATCH".
|
boolean |
isPost()
When ever this request is HTTP method is "POST".
|
boolean |
isPut()
When ever this request is HTTP method is "PUT".
|
void |
postInitComponent(Class<Object> clazz,
Object instance) |
void |
preCreateComponent(Class<Object> clazz) |
void |
preInitComponent(Class<Object> clazz,
Object instance) |
public WebScope(HttpBridletContext ctx)
ctx - The HTTP bridlet context for the current HTTP
request.public IocContext<WebScope> getIocContext()
public String getMethod()
public String getProtocol()
public String getHost()
public String getUserAgent()
public String getAccept()
public String getPath()
public String getOrigPath()
public String getContentType()
public boolean isGet()
public boolean isPost()
public boolean isDelete()
public boolean isPut()
public boolean isPatch()
public String getHeader(String header)
header - The header's name.public Map<String,HttpReqParam> getPostParameters()
public HttpReqParam getPostParameter(String parameter)
parameter - The post parameter name.public String[] getPostParametersNames()
public Map<String,HttpReqParam> getGetParameters()
public HttpReqParam getGetParameter(String parameter)
parameter - The "GET" parameter name.public String[] getGetParametersNames()
public Map<String,HttpCookie> getCookies()
public HttpCookie getCookie(String name)
name - The name of the HTTP Cookie.public HttpCookie addCookie(String name, String value)
name - The name of the HTTP Cookie.value - The value of the HTTP Cookie.public String[] getCookiesNames()
public void preCreateComponent(Class<Object> clazz)
preCreateComponent in interface ContextListener<Object>public void preInitComponent(Class<Object> clazz, Object instance)
preInitComponent in interface ContextListener<Object>public void postInitComponent(Class<Object> clazz, Object instance)
postInitComponent in interface ContextListener<Object>public WebSession getSession()
Copyright © 2015–2017 Bridje Framework. All rights reserved.