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.HttpServletRequestpublic String getContextPath()
getContextPath in interface javax.servlet.http.HttpServletRequestpublic javax.servlet.http.Cookie[] getCookies()
getCookies in interface javax.servlet.http.HttpServletRequestIllegalStateException - Not allowed in a portlet.public long getDateHeader(String name)
getDateHeader in interface javax.servlet.http.HttpServletRequestIllegalStateException - 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.HttpServletRequestPortletRequest.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.HttpServletRequestPortletRequest.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.HttpServletRequestPortletRequest.getProperties(String),
HttpServletRequest.getHeaders(String)public int getIntHeader(String name)
getIntHeader in interface javax.servlet.http.HttpServletRequestIllegalStateException - Not allowed in a portlet.public String getMethod()
getMethod in interface javax.servlet.http.HttpServletRequestpublic String getPathInfo()
getPathInfo in interface javax.servlet.http.HttpServletRequestpublic String getPathTranslated()
getPathTranslated in interface javax.servlet.http.HttpServletRequestpublic String getQueryString()
getQueryString in interface javax.servlet.http.HttpServletRequestpublic String getRemoteUser()
getRemoteUser in interface javax.servlet.http.HttpServletRequestpublic String getRequestURI()
getRequestURI in interface javax.servlet.http.HttpServletRequestIllegalStateException - Not allowed in a portlet.public StringBuffer getRequestURL()
getRequestURL in interface javax.servlet.http.HttpServletRequestIllegalStateException - Not allowed in a portlet.public String getRequestedSessionId()
getRequestedSessionId in interface javax.servlet.http.HttpServletRequestpublic 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.HttpServletRequestHttpServletRequest.getServletPath()public javax.servlet.http.HttpSession getSession()
PortletSession as a PortletHttpSession instance.getSession in interface javax.servlet.http.HttpServletRequestHttpServletRequest.getSession()public javax.servlet.http.HttpSession getSession(boolean create)
PortletSession as a PortletHttpSession instance.getSession in interface javax.servlet.http.HttpServletRequestHttpServletRequest.getSession(boolean)public Principal getUserPrincipal()
getUserPrincipal in interface javax.servlet.http.HttpServletRequestpublic boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie in interface javax.servlet.http.HttpServletRequestIllegalStateException - Not allowed in a portlet.public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL in interface javax.servlet.http.HttpServletRequestIllegalStateException - Not allowed in a portlet.public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl in interface javax.servlet.http.HttpServletRequestIllegalStateException - Not allowed in a portlet.public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid in interface javax.servlet.http.HttpServletRequestpublic boolean isUserInRole(String role)
isUserInRole in interface javax.servlet.http.HttpServletRequestpublic 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.ServletRequestServletRequest.getAttribute(java.lang.String)public Enumeration getAttributeNames()
getAttributeNames in interface javax.servlet.ServletRequestpublic String getCharacterEncoding()
getCharacterEncoding in interface javax.servlet.ServletRequestIllegalStateException - If the portlet is not in the event phase.ServletRequest.getCharacterEncoding()public int getContentLength()
getContentLength in interface javax.servlet.ServletRequestIllegalStateException - If the portlet is not in the event phase.ServletRequest.getContentLength()public String getContentType()
getContentType in interface javax.servlet.ServletRequestIllegalStateException - 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.ServletRequestIllegalStateException - If the portlet is not in the event phase.IOExceptionServletRequest.getInputStream()public String getLocalAddr()
getLocalAddr in interface javax.servlet.ServletRequestIllegalStateException - Not allowed in a portlet.public String getLocalName()
getLocalName in interface javax.servlet.ServletRequestIllegalStateException - Not allowed in a portlet.public int getLocalPort()
getLocalPort in interface javax.servlet.ServletRequestIllegalStateException - Not allowed in a portlet.public Locale getLocale()
getLocale in interface javax.servlet.ServletRequestpublic Enumeration getLocales()
getLocales in interface javax.servlet.ServletRequestpublic String getParameter(String name)
getParameter in interface javax.servlet.ServletRequestpublic Map getParameterMap()
getParameterMap in interface javax.servlet.ServletRequestpublic Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestpublic String[] getParameterValues(String name)
getParameterValues in interface javax.servlet.ServletRequestpublic String getProtocol()
getProtocol in interface javax.servlet.ServletRequestIllegalStateException - Not allowed in a portlet.public BufferedReader getReader() throws IOException
getReader in interface javax.servlet.ServletRequestIllegalStateException - If the portlet is not in the event phase.IOExceptionServletRequest.getReader()public String getRealPath(String path)
getRealPath in interface javax.servlet.ServletRequestpublic String getRemoteAddr()
getRemoteAddr in interface javax.servlet.ServletRequestIllegalStateException - Not allowed in a portlet.public String getRemoteHost()
getRemoteHost in interface javax.servlet.ServletRequestIllegalStateException - Not allowed in a portlet.public int getRemotePort()
getRemotePort in interface javax.servlet.ServletRequestIllegalStateException - Not allowed in a portlet.public javax.servlet.RequestDispatcher getRequestDispatcher(String path)
PortletRequestDispatcher as a
PortletServletRequestDispatcher instance.getRequestDispatcher in interface javax.servlet.ServletRequestServletRequest.getRequestDispatcher(java.lang.String)public String getScheme()
getScheme in interface javax.servlet.ServletRequestpublic String getServerName()
getServerName in interface javax.servlet.ServletRequestpublic int getServerPort()
getServerPort in interface javax.servlet.ServletRequestIllegalStateException - Not allowed in a portlet.public boolean isSecure()
isSecure in interface javax.servlet.ServletRequestpublic void removeAttribute(String name)
removeAttribute in interface javax.servlet.ServletRequestpublic void setAttribute(String name, Object o)
setAttribute in interface javax.servlet.ServletRequestpublic void setCharacterEncoding(String env) throws UnsupportedEncodingException
setCharacterEncoding in interface javax.servlet.ServletRequestIllegalStateException - If the portlet is not in the event phase.UnsupportedEncodingExceptionServletRequest.setCharacterEncoding(String)public javax.portlet.PortletRequest getPortletRequest()
PortletRequest instance.PortletRequest instance.Copyright © 2000–2016 Apache Software Foundation. All rights reserved.