|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--jdc.java.lang.Object
|
+--com.jdc.app.mvc.Model
|
+--com.jdc.http.mvc.HttpModel
HttpModel processes the user request, i.e. it is the Model in a Model-View-Controller (MVC) framework. Handles to the following implicit objects are provided to simpify usage by classes extending this class: request - The current HTTP servlet request object. response - The current HTTP servlet response object. session - The current HTTP user session object. user - The current user profile object browser - The type of browser in use.
| Field Summary | |
protected Browser |
browser
The type of browser used by the user to make the current request, e.g. |
protected ServletConfig |
config
The current servlet configuration object, if provided. |
protected ServletContext |
context
The current servlet context object, if provided. |
protected HttpServletRequest |
request
The current HTTP servlet request object. |
protected HttpServletResponse |
response
The current HTTP servlet response object. |
protected HttpSession |
session
The current HTTP user session object. |
protected HttpTransaction |
transaction
The current user transaction object. |
protected HttpUserProfile |
user
The current user, i.e. |
protected HttpView |
view
The current user view object. |
| Fields inherited from class com.jdc.app.mvc.Model |
currency, locale, log, number, string, timestamp, USER, VIEW |
| Constructor Summary | |
HttpModel(HttpServletRequest request,
HttpServletResponse response)
Constructs an HttpModel object. |
|
HttpModel(HttpServletRequest request,
HttpServletResponse response,
ServletContext context)
Constructs a HttpModel object. |
|
HttpModel(HttpServletRequest request,
HttpServletResponse response,
ServletContext context,
ServletConfig config)
Constructs a HttpModel object. |
|
| Method Summary | |
String |
addContext(String requestURL)
Adds the web application context to fully qualify a url. |
boolean |
areCookiesEnabled()
Returns true if cookies are enabled. |
void |
createCookie(String name,
String value,
int hours)
Creates a cookie to be stored on the user's computer. |
protected void |
displayCookies()
Displays current request cookies. |
protected void |
displayRequestParameters()
Displays current request parameters. |
HttpModel |
doRequest()
Handles the current HTTP servlet request. |
abstract HttpView |
doRequest(HttpView view)
Handles the current HTTP servlet request. |
Browser |
getBrowser()
Returns the type of browser used by the user to make the current request. |
ServletConfig |
getConfig()
Returns the current servlet configuration object, if provided. |
ServletContext |
getContext()
Returns the current servlet context object, if provided.. |
String |
getCookieValue(String cookieName)
Returns the cookie value for the requested cookie name, if the cookie exists. |
Locale |
getLocale()
Returns the user locale object. |
String |
getParameterValue(String parameterName)
Returns the parameter value for the requested parameter name, if the parameter exists. |
HttpServletRequest |
getRequest()
Returns the current HTTP servlet request object. |
HttpServletResponse |
getResponse()
Returns the current HTTP servlet response object. |
HttpSession |
getSession()
Returns the current HTTP user session object. |
Object |
getSessionAttribute(String name)
Returns the requested session attribute. |
String |
getTargetURL()
Returns the target Uniform Resource Locator (URL) for the request. |
String |
getText(String identifier)
Returns the resource display text for the specified display text identifier. |
String |
getText(String identifier,
String value)
Returns the resource display text for the specified display text identifier. |
String |
getText(String identifier,
String[] values)
Returns the resource display text for the specified display text identifier. |
String |
getText(String identifier,
String value1,
String value2)
Returns the resource display text for the specified display text identifier. |
HttpTransaction |
getTransaction()
Returns the current user transaction object. |
HttpUserProfile |
getUser()
Returns the current user, i.e. |
HttpView |
getView()
Returns the current user view object. |
boolean |
isGet()
Returns true if the method used to invoke current request is
GET. |
boolean |
isPost()
Returns true if the method used to invoke current request is
POST. |
void |
setNoCache()
Sets the appropriate HTTP servlet response object header to prevent the JSP page from being cached by the client browser. |
protected void |
setResource(String name)
Sets the resource bundle containing page labels and text for the current user locale. |
void |
setSessionAttribute(String name,
Object object)
Sets the requested session attribute. |
| Methods inherited from class com.jdc.app.mvc.Model |
setLocale |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected HttpServletRequest request
protected HttpServletResponse response
protected ServletContext context
protected ServletConfig config
protected HttpSession session
protected HttpUserProfile user
protected Browser browser
protected HttpTransaction transaction
protected HttpView view
| Constructor Detail |
public HttpModel(HttpServletRequest request,
HttpServletResponse response)
throws IllegalArgumentException
public HttpModel(HttpServletRequest request,
HttpServletResponse response,
ServletContext context)
throws RuntimeException
public HttpModel(HttpServletRequest request,
HttpServletResponse response,
ServletContext context,
ServletConfig config)
throws RuntimeException
| Method Detail |
public String addContext(String requestURL)
public boolean areCookiesEnabled()
public void createCookie(String name,
String value,
int hours)
protected void displayCookies()
protected void displayRequestParameters()
public abstract HttpView doRequest(HttpView view)
public HttpModel doRequest()
public Browser getBrowser()
public ServletConfig getConfig()
public ServletContext getContext()
public String getCookieValue(String cookieName)
public Locale getLocale()
getLocale in class Modelpublic String getParameterValue(String parameterName)
public HttpServletRequest getRequest()
public HttpServletResponse getResponse()
public HttpSession getSession()
public String getTargetURL()
public String getText(String identifier)
public String getText(String identifier,
String value)
public String getText(String identifier,
String value1,
String value2)
public String getText(String identifier,
String[] values)
public HttpTransaction getTransaction()
public HttpUserProfile getUser()
public HttpView getView()
public boolean isGet()
true if the method used to invoke current request is
GET. The servlet invoking this model object must extend
servlet class HttpController
True if the current request is a GET.public boolean isPost()
true if the method used to invoke current request is
POST. The servlet invoking this model object must extend
servlet class HttpController
True if the current request is a POST.public void setNoCache()
protected void setResource(String name)
public Object getSessionAttribute(String name)
public void setSessionAttribute(String name,
Object object)
|
2004.04.29 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||