|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.utexas.its.eis.tools.qwicap.servlet.Context
public class Context
Context
provides a few utility methods, as well as convenient access to hit-specific information, like
the HttpServletRequest
and HttpServletResponse
objects. Most of the time, Qwicap applications won't
need this class, but you can obtain the current instance of it by invoking the Qwicap.getContext()
method.
Method Summary | |
---|---|
File |
getExistingFile(String FileName)
Returns a File object corresponding to the specified file (or directory), if it exists. |
URL |
getExistingResource(String ResourceName)
Returns the URL for a resource supplied by the servlet container, for instance an HTML file within your web
application. |
File |
getFile(String FileName)
Returns a File object corresponding to the specified file (or directory), which may, or may not, exist. |
HttpServletRequest |
getRequest()
Returns the current HttpServletRequest instance. |
URL |
getResource(String ResourceName)
Returns the URL for a resource supplied by the servlet container, for instance an HTML file within your web
application. |
HttpServletResponse |
getResponse()
Returns the current HttpServletResponse instance. |
QwicapServlet |
getServlet()
Returns the current HttpServlet instance. |
Object |
getSessionAttribute(String Name)
If your web application is using session attributes, use this method to retrieve them, in order to avoid naming conflicts. |
void |
removeSessionAttribute(String Name)
If your web application is using session attributes, use this method to remove them, in order to avoid naming conflicts. |
void |
setSessionAttribute(String Name,
Object Value)
If your web application is using session attributes, use this method to set them, in order to avoid naming conflicts. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public QwicapServlet getServlet()
HttpServlet
instance.
HttpServlet
.public HttpServletRequest getRequest()
HttpServletRequest
instance.
HttpServletRequest
.public HttpServletResponse getResponse()
HttpServletResponse
instance.
HttpServletResponse
.public File getFile(String FileName) throws FileNotFoundException
File
object corresponding to the specified file (or directory), which may, or may not, exist.
FileName
- The name/path of a local file.
File
object corresponding to the specified local file, whether it
actually exists, or not.
FileNotFoundException
getExistingFile(java.lang.String)
public File getExistingFile(String FileName) throws FileNotFoundException
File
object corresponding to the specified file (or directory), if it exists. If it does not
exist, a FileNotFoundException
is thrown. The message in that exception will state the file/path that
was requested, and the absolute path of the location where this method believed the file would be found.
FileName
- The name/path of the local file that the caller asserts must exist.
File
object corresponding to the specified local file, if the
file exists.
FileNotFoundException
- If the file does not exist.public URL getResource(String ResourceName) throws MalformedURLException
URL
for a resource supplied by the servlet container, for instance an HTML file within your web
application. The name must begin with a slash character ('/'), so, if you wanted the URL for a file named
"index.html" located at the top level of your web application, you would pass the string "/index.html".
ResourceName
- The name/path of the resource to be supplied by the servlet container.
null
if
the resource could not be found.
MalformedURLException
- If ResourceName
does not begin with a slash character ('/'), or if
more conventional URL formation rules have somehow been violated.ServletContext.getResource(java.lang.String)
public URL getExistingResource(String ResourceName) throws FileNotFoundException, MalformedURLException
URL
for a resource supplied by the servlet container, for instance an HTML file within your web
application. The name must begin with a slash character ('/'), so, if you wanted the URL for a file named
"index.html" located at the top level of your web application, you would pass the string "/index.html".
ResourceName
- The name/path of the resource to be supplied by the servlet container.
MalformedURLException
- If ResourceName
does not begin with a slash character ('/'), or if
more conventional URL formation rules have somehow been violated.
FileNotFoundException
- If the requested resource could not be found.ServletContext.getResource(java.lang.String)
public Object getSessionAttribute(String Name)
Name
- The name of the session attribute to be retrieved.
public void setSessionAttribute(String Name, Object Value)
Name
- The name of the session attribute to be retrieved.Value
- The value of the session attribute.public void removeSessionAttribute(String Name)
Name
- The name of the session attribute to be removed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |