|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.iplanet.jato.view.ViewBase | +--com.iplanet.jato.view.ContainerViewBase | +--com.iplanet.jato.view.RequestHandlingViewBase | +--com.iplanet.jato.view.ViewBeanBase
A default implementation of ViewBean
.
Field Summary | |
static java.lang.String |
DEFAULT_COMMAND_CHILD_NVP_NAME
The name of the attribute used to store the default command child in the request parameters. |
static java.lang.String |
DISPLAY_EVENT_COMPLETED_REQUEST_ATTRIBUTE_NAME
A flag used to indicate that a CompleteRequestException was
thrown during a display event. |
static boolean |
OPTION_USE_PAGE_SESSION_FOR_DEFAULT_COMMAND_CHILD
Enabling is not recommended, as it is a fairly significant performance hit For example, it causes the page session to be deserialized twice in some cases, and causes the page session to be reserialized in situations in which it otherwise wouldn't. |
Fields inherited from class com.iplanet.jato.view.RequestHandlingViewBase |
HANDLE_REQUEST_METHOD_PREFIX, HANDLE_REQUEST_METHOD_SUFFIX |
Fields inherited from class com.iplanet.jato.view.ContainerViewBase |
BEGIN_DISPLAY_EVENT_METHOD_PREFIX, BEGIN_DISPLAY_EVENT_METHOD_SUFFIX, END_DISPLAY_EVENT_METHOD_PREFIX, END_DISPLAY_EVENT_METHOD_SUFFIX, eventMethodRegistry, OPTION_ENABLE_QUALIFIELD_CHILD_NAME_LOOKUPS, OPTION_USE_LEGACY_DISPLAY_EVENT_SIGNATURES |
Fields inherited from interface com.iplanet.jato.view.ViewBean |
PAGE_SESSION_ATTRIBUTE_NVP_NAME, VIEW_BEAN_NAME_SUFFIX |
Fields inherited from interface com.iplanet.jato.view.View |
QUALIFIED_VIEW_NAME_SEPARATOR |
Fields inherited from interface com.iplanet.jato.view.WebActionHandler |
DELETE_CONTEXT, EXECUTE_CONTEXT, INSERT_CONTEXT, MODEL_TYPE_DELETE, MODEL_TYPE_EXECUTE, MODEL_TYPE_INSERT, MODEL_TYPE_RETRIEVE, MODEL_TYPE_UPDATE, RETRIEVE_CONTEXT, UPDATE_CONTEXT |
Fields inherited from interface com.iplanet.jato.view.WebActions |
ACTION_CLEAR, ACTION_DELETE, ACTION_EXECUTE, ACTION_FIRST, ACTION_INSERT, ACTION_LAST, ACTION_NEXT, ACTION_PREV, ACTION_PREVIOUS, ACTION_REFRESH, ACTION_SELECT, ACTION_UPDATE |
Constructor Summary | |
|
ViewBeanBase(java.lang.String name)
Creates a ViewBeanBase object |
protected |
ViewBeanBase(View parent,
java.lang.String name)
Inappropriate for ViewBeans since they have no parent. |
Method Summary | |
void |
clearPageSessionAttributes()
This method clears all page-scoped "session" attributes from this view bean's internal list. |
protected View |
createChild(java.lang.String s)
Called to instantiate the named child. |
protected void |
deserializePageAttributes()
Deserializes the page session attributes. |
void |
forward(java.lang.String target,
ViewBean targetViewBean,
RequestContext requestContext)
Forward the request to the specified view bean and target resource. |
protected void |
forwardTo()
Forwards the request to this view bean, redisplaying the page. |
void |
forwardTo(RequestContext requestContext)
Forwards the request to this view bean, displaying the page. |
CommandDescriptor |
getDefaultCommandDescriptor()
Returns the default command descriptor that can be used to handle requests that are otherwise unhandled by this view or any of its children. |
java.lang.String |
getDefaultDisplayURL()
Returns the default URL that will be used to display this view bean. |
java.lang.String |
getDisplayURL()
Returns the URL that will be used to display this view bean. |
java.lang.String |
getModuleURL()
Returns this ViewBean's module URL. |
java.lang.Object |
getPageSessionAttribute(java.lang.String name)
This method gets the value of a page-scoped "session" attribute. |
protected java.util.Map |
getPageSessionAttributes()
Returns a Map of the page session attributes. |
java.lang.String |
getPageSessionAttributeString()
Returns the serialized page session attributes as a URL encoded string. |
java.lang.String |
getPageSessionAttributeString(boolean isEmbedded)
Returns the serialized page session attributes as a URL encoded string. |
java.lang.String |
getRequestInvocationName()
Returns a logical string that is used by the application servlet to dispatch a request to a particular target view bean. |
static java.lang.String |
getRequestInvocationName(ViewBean bean)
Returns a logical string that is used by the application servlet to dispatch a request to a particular target view bean. |
protected void |
include()
Includes this view bean in the current response. |
void |
include(RequestContext requestContext)
Forwards the request to this view bean, displaying the page. |
void |
include(java.lang.String target,
ViewBean targetViewBean,
RequestContext requestContext)
Include in the response output the target resource, using the specified view bean. |
boolean |
invokeRequestHandler()
Invokes the request handling mechanism that corresponds to the current request. |
protected boolean |
invokeRequestHandlerInternal(RequestHandler handler,
RequestContext requestContext)
Invokes the request handling mechanism on the child that corresponds to the generated request. |
void |
mapRequestParameters(javax.servlet.http.HttpServletRequest request)
Maps servlet request parameter values into subviews. |
java.lang.Object |
removePageSessionAttribute(java.lang.String name)
This method removes a page-scoped "session" attribute from this view bean's ' * internal list of attributes. |
void |
resetChildren()
Resets all children to a default state in a container-defined way. |
void |
securityCheck()
This method is the first method called during the display processing of the JSP, and should be used to enforce any security necessary to the display of this page. |
void |
setDefaultCommandDescriptor(CommandDescriptor value)
Sets the default command descriptor that can be used to handle requests that are otherwise unhandled by this view or any of its children. |
void |
setDefaultDisplayURL(java.lang.String value)
Sets the default URL that will be used to display this view bean. |
void |
setPageSessionAttribute(java.lang.String name,
java.io.Serializable value)
This method sets the value of a page-scoped "session" attribute. |
protected void |
setPageSessionAttributes(java.util.Map value)
Set the Map of the page session attributes. |
void |
setRequestContext(RequestContext context)
Sets the request context |
Methods inherited from class com.iplanet.jato.view.ViewBase |
getName, getParent, getParentViewBean, getQualifiedName, getRootView, getRootView, setName, setParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.iplanet.jato.view.ViewBean |
getModel, getSession, getViewBean |
Methods inherited from interface com.iplanet.jato.view.ContainerView |
beginChildDisplay, beginDisplay, endChildDisplay, endDisplay, getChild, getChildNames, getChildType, getDefaultModel, getDisplayField, getDisplayFieldValue, getNumChildren, setDisplayFieldValue |
Methods inherited from interface com.iplanet.jato.view.View |
getName, getParent, getQualifiedName, setParent |
Methods inherited from interface com.iplanet.jato.RequestHandler |
acceptRequest, getRequestContext, handleRequest |
Methods inherited from interface com.iplanet.jato.view.WebActionHandler |
getWebActionModels, handleWebAction, isAutoRetrieveEnabled, setAutoRetrieveEnabled |
Field Detail |
public static java.lang.String DISPLAY_EVENT_COMPLETED_REQUEST_ATTRIBUTE_NAME
CompleteRequestException
was
thrown during a display event. This attribute is used solely for the
"CompleteRequestException tunneling" workaround that allows developers
to throw CompleteRequestExceptions
from their display events
without the JSP subsystem catching and consuming them.public static final java.lang.String DEFAULT_COMMAND_CHILD_NVP_NAME
public static final boolean OPTION_USE_PAGE_SESSION_FOR_DEFAULT_COMMAND_CHILD
Constructor Detail |
public ViewBeanBase(java.lang.String name)
ViewBeanBase
objectname
- The logical name of this view.protected ViewBeanBase(View parent, java.lang.String name)
Method Detail |
protected View createChild(java.lang.String s)
ContainerViewBase
getChild(...)
method call.createChild
in class ContainerViewBase
com.iplanet.jato.view.ContainerViewBase
name
- The name of the child to instantiate. This method may
throw an IllegalArgumentException
to indicate an
improper child name.public void resetChildren()
ContainerView
DisplayField
, these children may be set to contain default values.resetChildren
in interface ContainerView
resetChildren
in class ContainerViewBase
public void securityCheck() throws SecurityCheckException
securityCheck
in interface ViewBean
public void setRequestContext(RequestContext context)
RequestParticipant
setRequestContext
in interface RequestParticipant
setRequestContext
in class RequestHandlingViewBase
com.iplanet.jato.RequestParticipant
requestContext
- The request context of the current requestpublic java.lang.String getDisplayURL()
ViewBean
getDefaultDisplayURL()
method.getDisplayURL
in interface ViewBean
com.iplanet.jato.view.ViewBean
public java.lang.String getDefaultDisplayURL()
getDefaultDisplayURL
in interface ViewBean
public void setDefaultDisplayURL(java.lang.String value)
setDefaultDisplayURL
in interface ViewBean
value
- The default display URL, relative to the context root. This
URL does NOT have to refer to a JSP, but normally should.public final java.lang.String getRequestInvocationName()
ViewBean
getRequestInvocationName
in interface ViewBean
com.iplanet.jato.view.ViewBean
public final java.lang.String getModuleURL()
ViewBean
action
attribute and to generate
HREFs in the JSP.getModuleURL
in interface ViewBean
public CommandDescriptor getDefaultCommandDescriptor()
null
if no
default command will be invokedpublic void setDefaultCommandDescriptor(CommandDescriptor value)
value
- The default command descriptor or null
if no
default command should be invokedprotected void forwardTo() throws NavigationException
RequestDispatcher.forward()
,
meaning that the same semantics apply to the use of this method.
This method makes implicit use of the display URL returned
by the getDisplayURL()
method.public void forwardTo(RequestContext requestContext) throws NavigationException
RequestDispatcher.forward()
,
meaning that the same semantics apply to the use of this method.
This method makes implicit use of the display URL returned
by the getDisplayURL()
method.forwardTo
in interface ViewBean
com.iplanet.jato.view.ViewBean
requestContext
- The current request context objectNavigationException
- Thrown by the servlet container if there is an error forwarding to the
view bean's default URL. This exception will only be thrown if the
container throws an IOException or ServletException, and that exception
will be available through the NavigationException's getRootCause()
method.protected void include() throws NavigationException
RequestDispatcher.include()
,
meaning that the same semantics apply to the use of this method.
This method makes implicit use of the display URL returned
by the getDisplayURL()
method.public void include(RequestContext requestContext) throws NavigationException
RequestDispatcher.forward()
,
meaning that the same semantics apply to the use of this method.
This method makes implicit use of the display URL returned
by the getDisplayURL()
method.public void forward(java.lang.String target, ViewBean targetViewBean, RequestContext requestContext) throws NavigationException
ViewBean
RequestDispatcher.forward(...)
.
Therefore, any actions taken after this method is called are subject to
the actions allowed by the servlet container.forward
in interface ViewBean
com.iplanet.jato.view.ViewBean
target
- The target resource (normally a JSP) used to render the specified
view bantargetViewBean
- The view bean to be rendered by the target resource. This instance is
placed in the request attributes so that is is automatically available
to the target JSP via a useBean directive. The name of the
request attribute containing the target view bean is specified by the
ViewBean.REQUEST_ATTRIBUTE_NAME
constant.requestContext
- The current request context objectNavigationException
- Thrown by the servlet container if there is an error forwarding to the
URL resource. This exception will only be thrown if the container
throws an IOException
or ServletException
,
and that exception will be available through the NavigationException
.getRootCause()
method.public void include(java.lang.String target, ViewBean targetViewBean, RequestContext requestContext) throws NavigationException
ViewBean
In terms of the interaction with the servlet container, this method is equivalent
to a call to RequestDispatcher.include(...)
. Therefore, any actions
taken after this method is called are subject to the actions allowed by the
servlet container.
include
in interface ViewBean
com.iplanet.jato.view.ViewBean
target
- The target resource (normally a JSP) used to render the specified
view bantargetViewBean
- The view bean to be rendered by the target resource. This instance is
placed in the request attributes so that is is automatically available
to the target JSP via a useBean directive. The name of the
request attribute containing the target view bean is specified by the
ViewBean.REQUEST_ATTRIBUTE_NAME
constant.requestContext
- The current request context objectNavigationException
- Thrown by the servlet container if there is an error including to the
view bean's default URL. This exception will only be thrown if the
container throws an IOException or ServletException, and that exception
will be available through the NavigationException's getRootCause()
method.public boolean invokeRequestHandler() throws java.lang.Exception
ViewBean
handleRequest
method on the
request-handling view that corresponds to the request. Such a view may be
the view bean itself or one of its children.invokeRequestHandler
in interface ViewBean
com.iplanet.jato.view.ViewBean
java.io.IOException
- Thrown if an exception occurs writing to the response output
stream during handling of the requestjavax.servlet.ServletException
- Thrown if any other exception occurs during handling of the requestprotected boolean invokeRequestHandlerInternal(RequestHandler handler, RequestContext requestContext) throws java.lang.Exception
RequestHandler
) to find a child that can accept the request. This
search is accomplished using the acceptRequest
method in
the RequestHandler
interface.java.io.IOException
- Thrown if an exception occurs writing to the response output
stream during handling of the requestjavax.servlet.ServletException
- Thrown if any other exception occurs during handling of the requestpublic java.lang.String getPageSessionAttributeString(boolean isEmbedded)
ViewBean
HREF
display fields
when they encode the page session information into the displaying page. This
method could also be called by developers wishing to include this information into
custom (non-ViewBean
-managed) hrefs or forms.
The page session API is intended to mirror the standard user session API, but
maintain values that are related only to a given page and request. This means
that the page session can be used to specify context information that is not
subject to confusion if the user presses his browser's Back button or
otherwise follows a different path through the application that is different
than the server's placement of the user within the application. Page session
objects are never actually stored in the HttpSession
.
For example, the page session attributes can be used to specify the current record being displayed on a page. If a user backtracks to a prior page using his browser's Back button and resubmits it, the application can take appropriate action that is based on the record location encoded in the page, rather than the location of the last rendered record. Page session attributes are automatically repopulated from their serialized form in the page when a page is resubmitted. Page session attributes are not automatically cleared when a page is displayed. Thus, they will automatically persist if a page is submitted and then redisplayed.
getPageSessionAttributeString
in interface ViewBean
com.iplanet.jato.view.ViewBean
isEmbedded
- If true, this method prefixes the string with a form name-value
separator ("&")public java.lang.String getPageSessionAttributeString()
HREF
display fields
when they encode the page session information into the displaying page. This
method could also be called by developers wishing to include this information into
custom (non-ViewBean
-managed) hrefs or forms.
The page session API is intended to mirror the standard user session API, but
maintain values that are related only to a given page and request. This means
that the page session can be used to specify context information that is not
subject to confusion if the user presses his browser's Back button or
otherwise follows a different path through the application that is different
than the server's placement of the user within the application. Page session
objects are never actually stored in the HttpSession
.
For example, the page session attributes can be used to specify the current record being displayed on a page. If a user backtracks to a prior page using his browser's Back button and resubmits it, the application can take appropriate action that is based on the record location encoded in the page, rather than the location of the last rendered record. Page session attributes are automatically repopulated from their serialized form in the page when a page is resubmitted. Page session attributes are not automatically cleared when a page is displayed. Thus, they will automatically persist if a page is submitted and then redisplayed.
protected void deserializePageAttributes()
This method is automatically called as part of the request handling logic in order to automatically repopulate the page session value Map from its serialized form.
protected java.util.Map getPageSessionAttributes()
The page session API is intended to mirror the standard user session API, but
maintain values that are related only to a given page and request. This means
that the page session can be used to specify context information that is not
subject to confusion if the user presses his browser's Back button or
otherwise follows a different path through the application that is different
than the server's placement of the user within the application. Page session
objects are never actually stored in the HttpSession
.
Page session attributes are automatically repopulated from their serialized form in the page when a page is resubmitted. Page session attributes are not automatically cleared when a page is displayed. Thus, they will automatically persist if a page is submitted and then redisplayed.
protected void setPageSessionAttributes(java.util.Map value)
The page session API is intended to mirror the standard user session API, but
maintain values that are related only to a given page and request. This means
that the page session can be used to specify context information that is not
subject to confusion if the user presses his browser's Back button or
otherwise follows a different path through the application that is different
than the server's placement of the user within the application. Page session
objects are never actually stored in the HttpSession
.
Page session attributes are automatically repopulated from their serialized form in the page when a page is resubmitted. Page session attributes are not automatically cleared when a page is displayed. Thus, they will automatically persist if a page is submitted and then redisplayed.
value
- The Map of the page session attributes.public java.lang.Object getPageSessionAttribute(java.lang.String name)
ViewBean
The page session API is intended to mirror the standard user session API, but
maintain values that are related only to a given page and request. This means
that the page session can be used to specify context information that is not
subject to confusion if the user presses his browser's Back button or
otherwise follows a different path through the application that is different
than the server's placement of the user within the application. Note that
the use of the term "session" here is for analogy only. Page session objects
are never actually stored in the HttpSession
.
For example, the page session attributes can be used to specify the current record being displayed on a page. If a user backtracks to a prior page using his browser's Back button and resubmits it, the application can take appropriate action that is based on the record location encoded in the page, rather than the location of the last rendered record.
Page session attributes are automatically repopulated from their serialized form in the page when a page is resubmitted. Page session attributes are not automatically cleared when a page is displayed. Thus, they will automatically persist if a page is submitted and then redisplayed.
getPageSessionAttribute
in interface ViewBean
com.iplanet.jato.view.ViewBean
name
- The name of the page session attribute to retrievepublic void setPageSessionAttribute(java.lang.String name, java.io.Serializable value)
ViewBean
The page session API is intended to mirror the standard user session API, but
maintain values that are related only to a given page and request. This means
that the page session can be used to specify context information that is not
subject to confusion if the user presses his browser's Back button or
otherwise follows a different path through the application that is different
than the server's placement of the user within the application. Page session
objects are never actually stored in the HttpSession
.
For example, the page session attributes can be used to specify the current record being displayed on a page. If a user backtracks to a prior page using his browser's Back button and resubmits it, the application can take appropriate action that is based on the record location encoded in the page, rather than the location of the last rendered record. Page session attributes are automatically repopulated from their serialized form in the page when a page is resubmitted. Page session attributes are not automatically cleared when a page is displayed. Thus, they will automatically persist if a page is submitted and then redisplayed.
setPageSessionAttribute
in interface ViewBean
com.iplanet.jato.view.ViewBean
name
- The name of the page session attribute to setvalue
- The page session attribute value. If this value is null, the page
session attribute is removed from the list of attributes and will not
be encoded into the next display of this view bean.public java.lang.Object removePageSessionAttribute(java.lang.String name)
ViewBean
The page session API is intended to mirror the standard user session API, but
maintain values that are related only to a given page and request. This means
that the page session can be used to specify context information that is not
subject to confusion if the user presses his browser's Back button or
otherwise follows a different path through the application that is different
than the server's placement of the user within the application. Page session
objects are never actually stored in the HttpSession
.
For example, the page session attributes can be used to specify the current record being displayed on a page. If a user backtracks to a prior page using his browser's Back button and resubmits it, the application can take appropriate action that is based on the record location encoded in the page, rather than the location of the last rendered record. Page session attributes are automatically repopulated from their serialized form in the page when a page is resubmitted. Page session attributes are not automatically cleared when a page is displayed. Thus, they will automatically persist if a page is submitted and then redisplayed.
removePageSessionAttribute
in interface ViewBean
com.iplanet.jato.view.ViewBean
name
- The name of the page session attribute to removereturn
- The page session attribute that was removed, or null if that attribute
did not exist.public void clearPageSessionAttributes()
ViewBean
The page session API is intended to mirror the standard user session API, but
maintain values that are related only to a given page and request. This means
that the page session can be used to specify context information that is not
subject to confusion if the user presses his browser's Back button or
otherwise follows a different path through the application that is different
than the server's placement of the user within the application. Page session
objects are never actually stored in the HttpSession
.
For example, the page session attributes can be used to specify the current record being displayed on a page. If a user backtracks to a prior page using his browser's Back button and resubmits it, the application can take appropriate action that is based on the record location encoded in the page, rather than the location of the last rendered record. Page session attributes are automatically repopulated from their serialized form in the page when a page is resubmitted. Page session attributes are not automatically cleared when a page is displayed. Thus, they will automatically persist if a page is submitted and then redisplayed.
clearPageSessionAttributes
in interface ViewBean
com.iplanet.jato.view.ViewBean
name
- The name of the page session attribute to removereturn
- The page session attribute that was removed, or null if that attribute
did not exist.public void mapRequestParameters(javax.servlet.http.HttpServletRequest request) throws ModelControlException
ContainerView
This method is called at the beginning of a servlet request in order to initialize this container and its children with values appropriate to the current request.
This method is currently required in this interface to support the intervention needed by the container to prepare its subviews. For example, subviews may have not know that they are contained by another view, and unbeknownst to it, that view's values may be represented in a way that is container dependent. Thus, the container must be able to intervene in the mapping of values to contained views.
mapRequestParameters
in interface ContainerView
mapRequestParameters
in class ContainerViewBase
com.iplanet.jato.view.ContainerView
request
- The request object of the current servlet requestModelControlException
- Thrown if manipulation of a model fails during mappingpublic static java.lang.String getRequestInvocationName(ViewBean bean)
bean
- The ViewBean in question.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |