public class PortletServletRequest extends Object implements javax.servlet.http.HttpServletRequest
PortletRequest
as a
HttpServletRequest
instance. Clients accessing this request object
will in fact operate on the PortletRequest
object wrapped by this
request object.Constructor and Description |
---|
PortletServletRequest(javax.portlet.PortletRequest portletRequest,
javax.portlet.PortletContext portletContext) |
PortletServletRequest(javax.portlet.PortletRequest portletRequest,
javax.portlet.PortletContext portletContext,
Map<String,String[]> extraParams) |
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String name)
Gets an attribute value on the
PortletRequest . |
Enumeration |
getAttributeNames() |
String |
getAuthType() |
String |
getCharacterEncoding()
Can only be invoked in the event phase.
|
int |
getContentLength()
Can only be invoked in the event phase.
|
String |
getContentType()
Can only be invoked in the event phase.
|
String |
getContextPath() |
javax.servlet.http.Cookie[] |
getCookies()
Not allowed in a portlet.
|
long |
getDateHeader(String name)
Not allowed in a portlet.
|
String |
getHeader(String name)
Gets a property from the
PortletRequest . |
Enumeration |
getHeaderNames()
Gets the property names from the
PortletRequest . |
Enumeration |
getHeaders(String name)
Gets the values for the specified property from the
PortletRequest . |
javax.servlet.ServletInputStream |
getInputStream()
Can only be invoked in the event phase.
|
int |
getIntHeader(String name)
Not allowed in a portlet.
|
String |
getLocalAddr()
Not allowed in a portlet.
|
Locale |
getLocale() |
Enumeration |
getLocales() |
String |
getLocalName()
Not allowed in a portlet.
|
int |
getLocalPort()
Not allowed in a portlet.
|
String |
getMethod() |
String |
getParameter(String name) |
Map |
getParameterMap() |
Enumeration |
getParameterNames() |
String[] |
getParameterValues(String name) |
String |
getPathInfo() |
String |
getPathTranslated() |
javax.portlet.PortletRequest |
getPortletRequest()
Get the wrapped
PortletRequest instance. |
String |
getProtocol()
Not allowed in a portlet.
|
String |
getQueryString() |
BufferedReader |
getReader()
Can only be invoked in the event phase.
|
String |
getRealPath(String path) |
String |
getRemoteAddr()
Not allowed in a portlet.
|
String |
getRemoteHost()
Not allowed in a portlet.
|
int |
getRemotePort()
Not allowed in a portlet.
|
String |
getRemoteUser() |
javax.servlet.RequestDispatcher |
getRequestDispatcher(String path)
Get the
PortletRequestDispatcher as a
PortletServletRequestDispatcher instance. |
String |
getRequestedSessionId() |
String |
getRequestURI()
Not allowed in a portlet.
|
StringBuffer |
getRequestURL()
Not allowed in a portlet.
|
String |
getScheme() |
String |
getServerName() |
int |
getServerPort()
Not allowed in a portlet.
|
String |
getServletPath()
A
PortletRequest has no servlet path. |
javax.servlet.http.HttpSession |
getSession()
Get the
PortletSession as a PortletHttpSession instance. |
javax.servlet.http.HttpSession |
getSession(boolean create)
Get the
PortletSession as a PortletHttpSession instance. |
Principal |
getUserPrincipal() |
boolean |
isRequestedSessionIdFromCookie()
Not allowed in a portlet.
|
boolean |
isRequestedSessionIdFromUrl()
Not allowed in a portlet.
|
boolean |
isRequestedSessionIdFromURL()
Not allowed in a portlet.
|
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isUserInRole(String role) |
void |
removeAttribute(String name) |
void |
setAttribute(String name,
Object o) |
void |
setCharacterEncoding(String env)
Can only be invoked in the event phase.
|
public PortletServletRequest(javax.portlet.PortletRequest portletRequest, javax.portlet.PortletContext portletContext)
public String getAuthType()
getAuthType
in interface javax.servlet.http.HttpServletRequest
public String getContextPath()
getContextPath
in interface javax.servlet.http.HttpServletRequest
public javax.servlet.http.Cookie[] getCookies()
getCookies
in interface javax.servlet.http.HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public long getDateHeader(String name)
getDateHeader
in interface javax.servlet.http.HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public String getHeader(String name)
PortletRequest
. Note that a
PortletRequest
is not guaranteed to map properties to headers.getHeader
in interface javax.servlet.http.HttpServletRequest
PortletRequest.getProperty(String)
,
HttpServletRequest.getHeader(java.lang.String)
public Enumeration getHeaderNames()
PortletRequest
. Note that a
PortletRequest
is not guaranteed to map properties to headers.getHeaderNames
in interface javax.servlet.http.HttpServletRequest
PortletRequest.getPropertyNames()
,
HttpServletRequest.getHeaderNames()
public Enumeration getHeaders(String name)
PortletRequest
. Note that a PortletRequest
is not
guaranteed to map properties to headers.getHeaders
in interface javax.servlet.http.HttpServletRequest
PortletRequest.getProperties(String)
,
HttpServletRequest.getHeaders(String)
public int getIntHeader(String name)
getIntHeader
in interface javax.servlet.http.HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public String getMethod()
getMethod
in interface javax.servlet.http.HttpServletRequest
public String getPathInfo()
getPathInfo
in interface javax.servlet.http.HttpServletRequest
public String getPathTranslated()
getPathTranslated
in interface javax.servlet.http.HttpServletRequest
public String getQueryString()
getQueryString
in interface javax.servlet.http.HttpServletRequest
public String getRemoteUser()
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
public String getRequestURI()
getRequestURI
in interface javax.servlet.http.HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public StringBuffer getRequestURL()
getRequestURL
in interface javax.servlet.http.HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public String getRequestedSessionId()
getRequestedSessionId
in interface javax.servlet.http.HttpServletRequest
public String getServletPath()
PortletRequest
has no servlet path. But for compatibility with
Struts 2 components and interceptors, the action parameter on the request
is mapped to the servlet path.getServletPath
in interface javax.servlet.http.HttpServletRequest
HttpServletRequest.getServletPath()
public javax.servlet.http.HttpSession getSession()
PortletSession
as a PortletHttpSession
instance.getSession
in interface javax.servlet.http.HttpServletRequest
HttpServletRequest.getSession()
public javax.servlet.http.HttpSession getSession(boolean create)
PortletSession
as a PortletHttpSession
instance.getSession
in interface javax.servlet.http.HttpServletRequest
HttpServletRequest.getSession(boolean)
public Principal getUserPrincipal()
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface javax.servlet.http.HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface javax.servlet.http.HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface javax.servlet.http.HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface javax.servlet.http.HttpServletRequest
public boolean isUserInRole(String role)
isUserInRole
in interface javax.servlet.http.HttpServletRequest
public Object getAttribute(String name)
PortletRequest
. If the attribute
name is javax.servlet.include.servlet_path, it returns the
same as getServletPath()
getAttribute
in interface javax.servlet.ServletRequest
ServletRequest.getAttribute(java.lang.String)
public Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.ServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
IllegalStateException
- If the portlet is not in the event phase.ServletRequest.getCharacterEncoding()
public int getContentLength()
getContentLength
in interface javax.servlet.ServletRequest
IllegalStateException
- If the portlet is not in the event phase.ServletRequest.getContentLength()
public String getContentType()
getContentType
in interface javax.servlet.ServletRequest
IllegalStateException
- If the portlet is not in the event phase.ServletRequest.getContentType()
public javax.servlet.ServletInputStream getInputStream() throws IOException
InputStream
as a
PortletServletInputStream
.getInputStream
in interface javax.servlet.ServletRequest
IllegalStateException
- If the portlet is not in the event phase.IOException
ServletRequest.getInputStream()
public String getLocalAddr()
getLocalAddr
in interface javax.servlet.ServletRequest
IllegalStateException
- Not allowed in a portlet.public String getLocalName()
getLocalName
in interface javax.servlet.ServletRequest
IllegalStateException
- Not allowed in a portlet.public int getLocalPort()
getLocalPort
in interface javax.servlet.ServletRequest
IllegalStateException
- Not allowed in a portlet.public Locale getLocale()
getLocale
in interface javax.servlet.ServletRequest
public Enumeration getLocales()
getLocales
in interface javax.servlet.ServletRequest
public String getParameter(String name)
getParameter
in interface javax.servlet.ServletRequest
public Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
public Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
public String[] getParameterValues(String name)
getParameterValues
in interface javax.servlet.ServletRequest
public String getProtocol()
getProtocol
in interface javax.servlet.ServletRequest
IllegalStateException
- Not allowed in a portlet.public BufferedReader getReader() throws IOException
getReader
in interface javax.servlet.ServletRequest
IllegalStateException
- If the portlet is not in the event phase.IOException
ServletRequest.getReader()
public String getRealPath(String path)
getRealPath
in interface javax.servlet.ServletRequest
public String getRemoteAddr()
getRemoteAddr
in interface javax.servlet.ServletRequest
IllegalStateException
- Not allowed in a portlet.public String getRemoteHost()
getRemoteHost
in interface javax.servlet.ServletRequest
IllegalStateException
- Not allowed in a portlet.public int getRemotePort()
getRemotePort
in interface javax.servlet.ServletRequest
IllegalStateException
- Not allowed in a portlet.public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
PortletRequestDispatcher
as a
PortletServletRequestDispatcher
instance.getRequestDispatcher
in interface javax.servlet.ServletRequest
ServletRequest.getRequestDispatcher(java.lang.String)
public String getScheme()
getScheme
in interface javax.servlet.ServletRequest
public String getServerName()
getServerName
in interface javax.servlet.ServletRequest
public int getServerPort()
getServerPort
in interface javax.servlet.ServletRequest
IllegalStateException
- Not allowed in a portlet.public boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
public void removeAttribute(String name)
removeAttribute
in interface javax.servlet.ServletRequest
public void setAttribute(String name, Object o)
setAttribute
in interface javax.servlet.ServletRequest
public void setCharacterEncoding(String env) throws UnsupportedEncodingException
setCharacterEncoding
in interface javax.servlet.ServletRequest
IllegalStateException
- If the portlet is not in the event phase.UnsupportedEncodingException
ServletRequest.setCharacterEncoding(String)
public javax.portlet.PortletRequest getPortletRequest()
PortletRequest
instance.PortletRequest
instance.Copyright © 2000–2020 Apache Software Foundation. All rights reserved.