public interface ContentRequest
NullPointerException
if the specified
parameter name, attribute name or object name is null
.Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String name)
Returns the specified attribute object or
null . |
String |
getBerliozPath()
Returns the dynamic path of the Berlioz request.
|
javax.servlet.http.Cookie[] |
getCookies()
Returns an array containing all of the Cookie objects the client sent with this request.
|
Date |
getDateParameter(String name)
Returns a
Date instance from the specified parameter. |
Environment |
getEnvironment()
Returns the environment of the request.
|
int |
getIntParameter(String name,
int def)
Returns the specified parameter value.
|
Location |
getLocation()
Returns information about the location of the request.
|
String |
getParameter(String name)
Returns the specified parameter value or
null . |
String |
getParameter(String name,
String def)
Returns the specified parameter value or the specified default if
null . |
Enumeration<String> |
getParameterNames()
Returns an
Enumeration of String objects containing the names of
the parameters contained in this request. |
String[] |
getParameterValues(String name)
Returns an array of String objects containing all of the values the given request parameter
has, or
null if the parameter does not exist. |
String |
getPathInfo()
Deprecated.
Use
PathInfo instead |
javax.servlet.http.HttpSession |
getSession()
Returns the session of the wrapped HTTP servlet request.
|
void |
setAttribute(String name,
Object o)
Sets the specified attribute object or
null . |
void |
setRedirect(String url,
ContentStatus code)
Sets the status of this request for redirection.
|
void |
setStatus(ContentStatus code)
Sets the status of this request.
|
@Deprecated String getPathInfo()
PathInfo
insteadString getBerliozPath()
The Berlioz path corresponds to:
pathInfo
when the Berlioz Servlet is mapped using a prefix servlet
(for example /html/*
);servletPath
when the Berlioz Servlet is mapped using a suffix servlet
(for example *.html
);Use this method in preference to the getPathInfo()
which only works if Berlioz is
mapped to prefixes.
String getParameter(String name)
null
.
This method guarantees that the returned value is not equal to an empty string.
name
- The name of the requested parameter.String
or null
.String getParameter(String name, String def)
null
.
This method guarantees that a value is returned.
name
- The name of the requested parameter.def
- A default value if the value is null
or empty string.int getIntParameter(String name, int def)
This method guarantees that a value is returned.
name
- The name of the requested parameter.def
- A default value if the value is null
or empty string.String[] getParameterValues(String name)
null
if the parameter does not exist.
If the parameter has a single value, the array has a length of 1.
name
- A String containing the name of the parameter whose value is requestedEnumeration<String> getParameterNames()
Enumeration
of String
objects containing the names of
the parameters contained in this request.
If the request has no parameters, the method returns an empty Enumeration.
Enumeration
of the names of each parameters as String
s;
or an empty Enumeration
if the request has no parameters.Object getAttribute(String name)
null
.name
- The name of the attribute.null
.void setAttribute(String name, Object o)
null
.name
- The name of the attribute.o
- The object for this attribute.Date getDateParameter(String name)
Date
instance from the specified parameter.
Important note: incompatible change, since Berlioz 0.8, dates are parsed as ISO 8601.
name
- The name of the parameter.Date
instance or null
if not specified.javax.servlet.http.Cookie[] getCookies()
null
if no cookies were sent.null
if the request has no cookiesjavax.servlet.http.HttpSession getSession()
Environment getEnvironment()
Location getLocation()
This includes information about the request URI.
void setStatus(ContentStatus code)
code
- The status code to use.NullPointerException
- if the status is null
.IllegalArgumentException
- if the status is a redirect status.void setRedirect(String url, ContentStatus code)
code
- The status code to use (required).url
- The URL to redirect to.NullPointerException
- if the URL is null
.IllegalArgumentException
- if the status is not a redirect status.Copyright © 2016 Allette Systems. All rights reserved.