Expose the Servlet spec's error attributes as HttpServletRequest
attributes under the keys defined in the Servlet 2.3 specification, for error pages that
are rendered directly rather than through the Servlet container's error page resolution:
javax.servlet.error.status_code,
javax.servlet.error.exception_type,
javax.servlet.error.message,
javax.servlet.error.exception,
javax.servlet.error.request_uri,
javax.servlet.error.servlet_name.

Expose the current request URI and paths as HttpServletRequest
attributes under the keys defined in the Servlet 2.4 specification,
for containers that implement 2.3 or an earlier version of the Servlet API:
javax.servlet.forward.request_uri,
javax.servlet.forward.context_path,
javax.servlet.forward.servlet_path,
javax.servlet.forward.path_info,
javax.servlet.forward.query_string.

isDefaultHtmlEscape

Return whether default HTML escaping is enabled for the web application,
i.e. the value of the "defaultHtmlEscape" context-param in web.xml
(if any). Falls back to false in case of no explicit default given.

getRealPath

Return the real path of the given path within the web application,
as provided by the servlet container.

Prepends a slash if the path does not already start with a slash,
and throws a FileNotFoundException if the path cannot be resolved to
a resource (in contrast to ServletContext's getRealPath,
which returns null).

getSessionAttribute

Check the given request for a session attribute of the given name.
Returns null if there is no session or if the session has no such attribute.
Does not create a new session if none has existed before!

Parameters:

request - current HTTP request

name - the name of the session attribute

Returns:

the value of the session attribute, or null if not found

getRequiredSessionAttribute

Check the given request for a session attribute of the given name.
Throws an exception if there is no session or if the session has no such
attribute. Does not create a new session if none has existed before!

getOrCreateSessionAttribute

Get the specified session attribute, creating and setting a new attribute if
no existing found. The given class needs to have a public no-arg constructor.
Useful for on-demand state objects in a web tier, like shopping carts.

getSessionMutex

Return the best available mutex for the given session:
that is, an object to synchronize on for the given session.

Returns the session mutex attribute if available; usually,
this means that the HttpSessionMutexListener needs to be defined
in web.xml. Falls back to the HttpSession itself
if no mutex attribute found.

The session mutex is guaranteed to be the same object during
the entire lifetime of the session, available under the key defined
by the SESSION_MUTEX_ATTRIBUTE constant. It serves as a
safe reference to synchronize on for locking on the current session.

In many cases, the HttpSession reference itself is a safe mutex
as well, since it will always be the same object reference for the
same active logical session. However, this is not guaranteed across
different servlet containers; the only 100% safe way is a session mutex.

exposeForwardRequestAttributes

Expose the current request URI and paths as HttpServletRequest
attributes under the keys defined in the Servlet 2.4 specification,
for containers that implement 2.3 or an earlier version of the Servlet API:
javax.servlet.forward.request_uri,
javax.servlet.forward.context_path,
javax.servlet.forward.servlet_path,
javax.servlet.forward.path_info,
javax.servlet.forward.query_string.

Does not override values if already present, to not cause conflicts
with the attributes exposed by Servlet 2.4+ containers themselves.

Parameters:

request - current servlet request

exposeErrorRequestAttributes

Expose the Servlet spec's error attributes as HttpServletRequest
attributes under the keys defined in the Servlet 2.3 specification, for error pages that
are rendered directly rather than through the Servlet container's error page resolution:
javax.servlet.error.status_code,
javax.servlet.error.exception_type,
javax.servlet.error.message,
javax.servlet.error.exception,
javax.servlet.error.request_uri,
javax.servlet.error.servlet_name.

Does not override values if already present, to respect attribute values
that have been exposed explicitly before.

Exposes status code 200 by default. Set the "javax.servlet.error.status_code"
attribute explicitly (before or after) in order to expose a different status code.

findParameterValue

This method will try to obtain a parameter value using the
following algorithm:

Try to get the parameter value using just the given logical name.
This handles parameters of the form logicalName = value. For normal
parameters, e.g. submitted using a hidden HTML form field, this will return
the requested value.

Try to obtain the parameter value from the parameter name, where the
parameter name in the request is of the form logicalName_value = xyz
with "_" being the configured delimiter. This deals with parameter values
submitted using an HTML form submit button.

If the value obtained in the previous step has a ".x" or ".y" suffix,
remove that. This handles cases where the value was submitted using an
HTML form image button. In this case the parameter in the request would
actually be of the form logicalName_value.x = 123.

Parameters:

parameters - the available parameter map

name - the logical name of the request parameter

Returns:

the value of the parameter, or null
if the parameter does not exist in given request

parseMatrixVariables

Parse the given string with matrix variables. An example string would look
like this "q1=a;q1=b;q2=a,b,c". The resulting map would contain
keys "q1" and "q2" with values ["a","b"] and
["a","b","c"] respectively.