|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts2.portlet.servlet.PortletServletRequest
public class PortletServletRequest
Wrapper object exposing a PortletRequest
as a HttpServletRequest
instance.
Clients accessing this request object will in fact operate on the
PortletRequest
object wrapped by this request object.
Field Summary | |
---|---|
private javax.portlet.PortletContext |
portletContext
|
private javax.portlet.PortletRequest |
portletRequest
|
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Fields inherited from interface org.apache.struts2.portlet.PortletActionConstants |
---|
ACTION_PARAM, ACTION_RESET, DEFAULT_ACTION_FOR_MODE, DEFAULT_ACTION_NAME, DEFAULT_DISPATCHER_SERVLET_NAME, ERROR_ACTION, EVENT_ACTION, EVENT_PHASE, MODE_NAMESPACE_MAP, MODE_PARAM, PHASE, PORTLET_CONFIG, PORTLET_NAMESPACE, RENDER_DIRECT_LOCATION, RENDER_PHASE, REQUEST, RESPONSE, STACK_FROM_EVENT_PHASE |
Constructor Summary | |
---|---|
PortletServletRequest(javax.portlet.PortletRequest portletRequest,
javax.portlet.PortletContext portletContext)
|
Method Summary | |
---|---|
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()
|
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 . |
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()
|
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. |
HttpSession |
getSession()
Get the PortletSession as a PortletHttpSession instance. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.portlet.PortletRequest portletRequest
private javax.portlet.PortletContext portletContext
Constructor Detail |
---|
public PortletServletRequest(javax.portlet.PortletRequest portletRequest, javax.portlet.PortletContext portletContext)
Method Detail |
---|
public String getAuthType()
getAuthType
in interface HttpServletRequest
public String getContextPath()
getContextPath
in interface HttpServletRequest
public Cookie[] getCookies()
getCookies
in interface HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public long getDateHeader(String name)
getDateHeader
in interface 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 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 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 HttpServletRequest
PortletRequest.getProperties(String)
,
HttpServletRequest.getHeaders(String)
public int getIntHeader(String name)
getIntHeader
in interface HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public String getMethod()
getMethod
in interface HttpServletRequest
public String getPathInfo()
getPathInfo
in interface HttpServletRequest
public String getPathTranslated()
getPathTranslated
in interface HttpServletRequest
public String getQueryString()
getQueryString
in interface HttpServletRequest
public String getRemoteUser()
getRemoteUser
in interface HttpServletRequest
public String getRequestURI()
getRequestURI
in interface HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public StringBuffer getRequestURL()
getRequestURL
in interface HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public String getRequestedSessionId()
getRequestedSessionId
in interface 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 HttpServletRequest
HttpServletRequest.getServletPath()
public HttpSession getSession()
PortletSession
as a PortletHttpSession
instance.
getSession
in interface HttpServletRequest
HttpServletRequest.getSession()
public HttpSession getSession(boolean create)
PortletSession
as a PortletHttpSession
instance.
getSession
in interface HttpServletRequest
HttpServletRequest.getSession(boolean)
public Principal getUserPrincipal()
getUserPrincipal
in interface HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface HttpServletRequest
IllegalStateException
- Not allowed in a portlet.public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface HttpServletRequest
public boolean isUserInRole(String role)
isUserInRole
in interface 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 ServletRequest
ServletRequest.getAttribute(java.lang.String)
public Enumeration getAttributeNames()
getAttributeNames
in interface ServletRequest
public String getCharacterEncoding()
getCharacterEncoding
in interface ServletRequest
IllegalStateException
- If the portlet is not in the event phase.ServletRequest.getCharacterEncoding()
public int getContentLength()
getContentLength
in interface ServletRequest
IllegalStateException
- If the portlet is not in the event phase.ServletRequest.getContentLength()
public String getContentType()
getContentType
in interface ServletRequest
IllegalStateException
- If the portlet is not in the event phase.ServletRequest.getContentType()
public ServletInputStream getInputStream() throws IOException
InputStream
as a PortletServletInputStream
.
getInputStream
in interface ServletRequest
IllegalStateException
- If the portlet is not in the event phase.
IOException
ServletRequest.getInputStream()
public String getLocalAddr()
getLocalAddr
in interface ServletRequest
IllegalStateException
- Not allowed in a portlet.public String getLocalName()
getLocalName
in interface ServletRequest
IllegalStateException
- Not allowed in a portlet.public int getLocalPort()
getLocalPort
in interface ServletRequest
IllegalStateException
- Not allowed in a portlet.public Locale getLocale()
getLocale
in interface ServletRequest
public Enumeration getLocales()
getLocales
in interface ServletRequest
public String getParameter(String name)
getParameter
in interface ServletRequest
public Map getParameterMap()
getParameterMap
in interface ServletRequest
public Enumeration getParameterNames()
getParameterNames
in interface ServletRequest
public String[] getParameterValues(String name)
getParameterValues
in interface ServletRequest
public String getProtocol()
getProtocol
in interface ServletRequest
IllegalStateException
- Not allowed in a portlet.public BufferedReader getReader() throws IOException
getReader
in interface ServletRequest
IllegalStateException
- If the portlet is not in the event phase.
IOException
ServletRequest.getReader()
public String getRealPath(String path)
getRealPath
in interface ServletRequest
public String getRemoteAddr()
getRemoteAddr
in interface ServletRequest
IllegalStateException
- Not allowed in a portlet.public String getRemoteHost()
getRemoteHost
in interface ServletRequest
IllegalStateException
- Not allowed in a portlet.public int getRemotePort()
getRemotePort
in interface ServletRequest
IllegalStateException
- Not allowed in a portlet.public RequestDispatcher getRequestDispatcher(String path)
PortletRequestDispatcher
as a PortletServletRequestDispatcher
instance.
getRequestDispatcher
in interface ServletRequest
ServletRequest.getRequestDispatcher(java.lang.String)
public String getScheme()
getScheme
in interface ServletRequest
public String getServerName()
getServerName
in interface ServletRequest
public int getServerPort()
getServerPort
in interface ServletRequest
IllegalStateException
- Not allowed in a portlet.public boolean isSecure()
isSecure
in interface ServletRequest
public void removeAttribute(String name)
removeAttribute
in interface ServletRequest
public void setAttribute(String name, Object o)
setAttribute
in interface ServletRequest
public void setCharacterEncoding(String env) throws UnsupportedEncodingException
setCharacterEncoding
in interface ServletRequest
IllegalStateException
- If the portlet is not in the event phase.
UnsupportedEncodingException
ServletRequest.setCharacterEncoding(String)
public javax.portlet.PortletRequest getPortletRequest()
PortletRequest
instance.
PortletRequest
instance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |