|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.api.request.RequestUtil
public class RequestUtil
Constructor Summary | |
---|---|
RequestUtil()
|
Method Summary | |
---|---|
static java.lang.String |
getServletName(javax.servlet.Servlet servlet)
Utility method to return a name for the given servlet. |
static boolean |
handleIfModifiedSince(SlingHttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Checks if the request contains a if-last-modified-since header and if the the request's underlying resource has a jcr:lastModified property. if the properties were modified before the header a 304 is sent otherwise the response last modified header is set. |
static java.util.Map<java.lang.String,java.lang.Double> |
parserAcceptHeader(java.lang.String value)
Parses an Accept-* header of the form:
Header = Token { "," Token } . |
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
parserHeader(java.lang.String value)
Parses a header of the form: Header = Token { "," Token } . |
static java.lang.Object |
setRequestAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String name,
java.lang.Object value)
Sets the named request attribute to the new value and returns the previous value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequestUtil()
Method Detail |
---|
public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parserHeader(java.lang.String value)
Header = Token { "," Token } . Token = name { ";" Parameter } . Paramter = name [ "=" value ] ."," and ";" are not allowed within name and value
value
-
public static java.util.Map<java.lang.String,java.lang.Double> parserAcceptHeader(java.lang.String value)
Accept-*
header of the form:
Header = Token { "," Token } . Token = name { ";" "q" [ "=" value ] } . Paramter = ."," and ";" are not allowed within name and value
value
-
Double
instances providing the value of the
q
parameter.public static java.lang.String getServletName(javax.servlet.Servlet servlet)
null
,
non-empty name:
public static java.lang.Object setRequestAttribute(javax.servlet.http.HttpServletRequest request, java.lang.String name, java.lang.Object value)
request
- The request object whose attribute is to be set.name
- The name of the attribute to be set.value
- The new value of the attribute. If this is null
the attribte is actually removed from the request.
null
if it was not set.public static boolean handleIfModifiedSince(SlingHttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- the requestresp
- the response
true
if the response was set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |