Base interface of keys used in some attribute scopes by the framework.
All attributes used by the framework start with a '_' to avoid possible
collisions with application attributes ( unless application attributes
also follow this convention ).
To obtain the real used key from the constant eliminate the _KEY suffix
and convert to lowercase. For example _FORM_ACTION_KEY will result
in "_form_action". Literal keys are often required in the JSP files.
Author:
Santiago Arriaga
Field Summary
static java.lang.String
_BUNDLE_KEY
Used for a bundle Map cache of keys for the current application.
static java.lang.String
_CONFIGURATION_KEY
Stores the confiugration instance for the global application.
_FORM_ACTION_KEY
used to indicate a form which is the default form action.
static java.lang.String
_FORM_ATTRIBUTE_KEY
stored at request scope to indicate a form which is the default bean
AttibuteInfo which is a pointer to another attribute which
holds the default bean of the current page.
static java.lang.String
_LOCALE_KEY
Used for the locale cache in ControllerTools.
static java.lang.String
_MESSAGE_KEY
Message CompoundMessage stored at session level.
static java.lang.String
_NAVIGATION_FLOW_KEY
The navigation flow entry stored at portlet or session level.
Used for a bundle Map cache of keys for the current application. This
is used to obtain strings easily from a resource bundle in cases where
a single language is used for a site. Useful for embedding strings
within the values of an HTML tag, without having to access a JSTL
format message tag, for example:
This may not be useful for all type of applications, especially
applications where languages may be applied on a page basis.
static final java.lang.String _DEFAULT_CONTROLLER_KEY
Stores the default controller if any at context level. This is used
for navigation purposes, the default controller is always set first
in the navigation flow of a user.
used to indicate a form which is the default form action. Sometimes
the action of a form may depend on previous dynamic conditions. A
controller may set this attribute at request level ( preferably )
before entering a form with no action tag attribute set.
stored at request scope to indicate a form which is the default bean
AttibuteInfo which is a pointer to another attribute which
holds the default bean of the current page. This is
used by the isNewForm() and setFormAttribute() methods.
Used for the locale cache in ControllerTools. The locale is obtained
mainly from the JSTL setting and set at any scope. It is maintained
as a Locale object because JSTL maintains a String, and sometimes
a Locale object is needed instaead.
Message CompoundMessage stored at session level. This may be used for user-
defined messages. Some handlers move this key from session to request
before entering a view, to the message will only be valid for the
given view. This allows for redirections and not loosing the message
before displaying it, but when a view is finally chosen for displaying
the message, the message is set at request level. A consistent layout
for displaying messages and validation exceptions is then strongly
recommended for every view of an application, so feedback for users
won't be lost.
The preferred way to set a message in session is using the setMessage()
method in com.acsinet_solutions.cetia4.controller.RequestContext
interface. This allows for transparent multiple message notifications
using the CompoundMessage class, and simplifies the JSP or view creation.
static final java.lang.String _NAVIGATION_FLOW_KEY
The navigation flow entry stored at portlet or session level. It may
be obtained at any render or action method to examine it, and maybe
modify it. This will modify the navigation state and thus the breadcrumb
in a page ( if any ). The current stage ( called render page ) will be
added to the navigation flow before rendering in web related apps.
Action requests do not alter navigation flow by default.
Web service applications are mostly stateless, so the do not normally
use this object ( although the design of a stateful web service
application is certainly possible, but REST principles don't recommend
this ).
Stores the portal path at page level. This if done within the cetia:init
tag. This is a simple and very useful way to indicate the path to a
main application within a single web container implementation. The
main application may contain common images, CSS resources and scripts,
so they don't have to be duplicated in every application. If not used,
this path corresponds to the current application context path string, so
no harm is done, and it could be a short nice replacement to the more
verbose ${ pageContext.request.contextPath }. The cetia:init tag must
be called anyway before using this in a page, and the PORTAL_PATH_PARAM
must be set.
static final java.lang.String _RENDER_PARAMETERS_KEY
Stores the render parameter map at request level. Currently this only
happend in web service actions as a means to obtain and display them in
the response XML ( as a convenience feature ).
In web servlet environments, these parameters are
set as HTTP parameters for the next render request. In a portlet
environment ( when ready ) thew will be the typical render parameters.
static final java.lang.String _SERVICE_LOCATOR_KEY
Store context wide service locator here. ServiceInitializerBase class
always uses this key to store the service locator, and ControllerTools
always uses this key to read it. It can be stored and read manually
by using standard attribute methods also, if desired. A service locator
must implement the ServiceLocator interface; any other interfaces like
WebServiceLocator are completely optional.
Used for storage of the session object within the session. The presence
of a session object indicates the framework that the user has somehow
being authenticated. Authentication may have happened using J2EE standard
means, but this object is anyway necessary within the Cetia framework.
static final java.lang.String _SYSTEM_EXCEPTION_KEY
System exception stored at session level. This may be displayed in an
special error page or also as part of a normal page, so the application
layout must consider this. The cetia:writeException tag may be used to
display these types of exceptions.
System exceptions may be any checked or runtime exception. Explicit
handling or Errors is generally discouraged in the java platform.
Some applications won't desire to print exceptions to a user, so the
com.acsinet_solutions.cetia4.controller.ControllerConstants.DISPLAY_SYSTEM_EXCEPTIONS_PARAM
init param may be used to allow/disallow this in a page.
static final java.lang.String _VALIDATION_EXCEPTION_KEY
Validation exception stored at session level. As it occurs with
_MESSAGE_KEY and _SYSTEM_EXCEPTION_KEY, the default web handlers copy
these from session to request before displaying a page, so they won't be
reported duplicated in more than a single page. Although this may be
any type of exception, it should preferably be a
com.acsinet_solutions.util.exception.ValidationException or
com.acsinet_solutions.util.exception.ValidationRuntimeException. This are
the only types of validation exception currently recognized by the platform,
and other types of exceptions in a render or action method will be treated
as system exceptions and may result in an error page or other undesired
navigation. Support for other common types of validation exceptions may
be added eventually in a pluggable way, if needed.