public class ContextResource extends AbstractResource
Resource for resources found within the web
application context.
Note: moved from Tapestry. Originally part of Tapestry 3.0.
| Constructor and Description |
|---|
ContextResource(javax.servlet.ServletContext context,
java.lang.String path) |
ContextResource(javax.servlet.ServletContext context,
java.lang.String path,
java.util.Locale locale) |
| Modifier and Type | Method and Description |
|---|---|
Resource |
getLocalization(java.util.Locale locale)
Locates the resource using
LocalizedContextResourceFinder and
ServletContext.getResource(java.lang.String). |
java.net.URL |
getResourceURL()
Returns a URL for the resource.
|
int |
hashCode() |
protected Resource |
newResource(java.lang.String path) |
java.lang.String |
toString() |
equals, getLocale, getName, getPath, getRelativeResourcepublic ContextResource(javax.servlet.ServletContext context, java.lang.String path)
public ContextResource(javax.servlet.ServletContext context, java.lang.String path, java.util.Locale locale)
public Resource getLocalization(java.util.Locale locale)
LocalizedContextResourceFinder and
ServletContext.getResource(java.lang.String).locale - to localize for, or null for no localization.public java.net.URL getResourceURL()
Resourcepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectprotected Resource newResource(java.lang.String path)
newResource in class AbstractResource