|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry.portlet.PortletWebContext
public class PortletWebContext
Adapts PortletContext
as
WebContext
.
Constructor Summary | |
---|---|
PortletWebContext(javax.portlet.PortletContext portletContext)
|
Method Summary | |
---|---|
void |
describeTo(DescriptionReceiver receiver)
Invoked to have the receiver describe itself (largely in terms of properties and values). |
Object |
getAttribute(String name)
Returns the named object, or null if no attribute has been stored with the given name. |
List |
getAttributeNames()
Returns a list of all known attributes in ascending alphabetical order. |
List |
getInitParameterNames()
Returns a sorted list of the names of all initialization parameters (which may be the empty list). |
String |
getInitParameterValue(String name)
Returns the value of the named parameter, or null if the reciever does not have such a parameter. |
String |
getMimeType(String resourcePath)
Returns the MIME type of the specified file, or null if the MIME type is not known. |
String |
getRealPath(String path)
Returns a String containing the real path for a given virtual path. |
URL |
getResource(String path)
Returns a URL to the resource that is mapped to a specified path. |
InputStream |
getResourceAsStream(String path)
Returns the resource located at the named path as an InputStream
object. |
Set |
getResourcePaths(String path)
Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument. |
void |
setAttribute(String name,
Object attribute)
Updates the attribute, replacing (or removing) its value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PortletWebContext(javax.portlet.PortletContext portletContext)
Method Detail |
---|
public URL getResource(String path)
WebContext
getResource
in interface WebContext
public List getAttributeNames()
AttributeHolder
getAttributeNames
in interface AttributeHolder
public Object getAttribute(String name)
AttributeHolder
getAttribute
in interface AttributeHolder
public void setAttribute(String name, Object attribute)
AttributeHolder
WebSession
attribute in a clustered application).
setAttribute
in interface AttributeHolder
name
- the name of the attribute to updateattribute
- the new value for the attribute, or null to delete the attribute entirely.public List getInitParameterNames()
InitializationParameterHolder
getInitParameterNames
in interface InitializationParameterHolder
public String getInitParameterValue(String name)
InitializationParameterHolder
getInitParameterValue
in interface InitializationParameterHolder
name
- the name of the parameter to retrieve
public String getMimeType(String resourcePath)
WebContext
getMimeType
in interface WebContext
public void describeTo(DescriptionReceiver receiver)
Describable
toString()
.
describeTo
in interface Describable
public String getRealPath(String path)
WebContext
String
containing the real path for a given virtual path.
For example, the path "/index.html" returns the absolute file path
on the server's filesystem would be served by a request for
"http://host/contextPath/index.html", where contextPath is the
context path of this WebContext.
getRealPath
in interface WebContext
path
- a String
specifying a virtual path
String
specifying the real path, or null
if the
translation cannot be performedpublic InputStream getResourceAsStream(String path)
WebContext
InputStream
object.
getResourceAsStream
in interface WebContext
path
- a String
specifying the path to the resource
InputStream
returned to the servlet,
or null
if no resource exists at the specified pathpublic Set getResourcePaths(String path)
WebContext
getResourcePaths
in interface WebContext
path
- partial path used to match the resources, which must start with a '/'
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |