public class PageTesterContext extends Object implements Context
| Constructor and Description |
|---|
PageTesterContext(String contextRoot) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String name)
Returns an attribute previously stored into the context with the given name.
|
List<String> |
getAttributeNames()
Returns the names of all attributes of the context, sorted alphabetically.
|
String |
getInitParameter(String name)
Returns an initial parameter value defined by servlet.
|
String |
getMimeType(String file)
Returns the MIME content type of the specified file, or null if no content type is known.
|
File |
getRealFile(String path)
Always returns null.
|
URL |
getResource(String path)
Returns a URL to a resource stored within the context.
|
List<String> |
getResourcePaths(String path)
Looks for resources within the web application within the supplied path.
|
public PageTesterContext(String contextRoot)
public String getInitParameter(String name)
ContextgetInitParameter in interface Contextpublic URL getResource(String path)
ContextgetResource in interface Contextpath - to the resource (with a leading slash)public List<String> getResourcePaths(String path)
ContextgetResourcePaths in interface Contextpath - to search for (should start with a leading slash)public Object getAttribute(String name)
ContextgetAttribute in interface Contextname - used to retrieve the attributepublic List<String> getAttributeNames()
ContextgetAttributeNames in interface Contextpublic String getMimeType(String file)
ContextgetMimeType in interface Contextfile - name of filepublic File getRealFile(String path)
getRealFile in interface Contextpath - to the resource (with a leading slash)5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.