Sun ONE Application Framework (JATO)

Version 1.1 Changes

Table of Contents

Developer Assistance

Deployment Changes

Tag Library Changes

ViewBean & Request Dispatch Changes

Event Changes

View Changes

Model Support Changes

Miscellaneous Changes

Change Log

The following changes were made from JATO 1.0 to JATO 1.1:

Developer Assistance
Changes Requires 1.0 App Changes
Added JATO templates and documentation on how to use templates  
Added JATO tag library plug-in palette for Macromedia Dreamweaver 3.x and higher  
Added JATO tag library reference document  

Added <JATO package>.util.TypeConverter class for easy conversion of types. This class is now used in JATO where needed, and can also be used by developers for painless type conversion.

Example:

int foo=TypeConverter.asInt(getSession().getAttribute("foo"));

 

Deployment Changes
Changes Requires 1.0 App Changes
New deployment descriptor entries needed for proper deployment. See the JATO Deployment Guide for more information.
Yes

Changed the JATO page URL invocation style from query string style to path info style. See the JATO Deployment Guide for more information.

Yes

Tag Library Changes
Changes Requires 1.0 App Changes
Fixed hidden tag rendering bug (bug #28)  

Added TextAreaTag to the taglib package
   Tag: <jato:textArea>

Maybe

Added PasswordTag to the taglib package
   Tag: <jato:password>

 

Added GetModelFieldValueTag to the taglib package
   Tag: <jato:getModelFieldValue>

 

Added SetModelFieldValueTag to the taglib package
   Tag: <jato:setModelFieldValue>

 
Added support for URL anchors  

Added better error handling for situation where an end user mistakenly enters a URL that calls a JATO JSP directly. JATO 1.0 used to throw a NullPointerException in the FormTag.doStartTag() method). JATO 1.1 throws a better exception if the current view bean's request context is null.

 

Changed the names of the following tags to be more self-describing:

1.0 tags:

<jato:view>
<jato:fieldValue>
<jato:setFieldValue>

1.1 tags:

<jato:containerView>
<jato:getDisplayFieldValue>
<jato:setDisplayFieldValue>

Maybe

Changed (relaxed) restrictions for taglib peers. Tag handlers now only require the following peer view/display field types:

Tag                 View Peer
---------------------------------

ButtonTag           Command
CheckBoxTag         BooleanDisplayField
ComboBoxTag         SelectableGroup
FrameSrcTag         DisplayField
HiddenTag           DisplayField
HrefTag             Command
ImageTag            DisplayField
ListBoxTag          SelectableGroup
PasswordTag         DisplayField
RadioButtonsTag     SelectableGroup
StaticTextFieldTag  DisplayField
TextAreaTag         DisplayField
TextFieldTag        DisplayField

 
Added ability to turn off tag extra info (TEI) for the taglib. This feature was necessary to get around JSP translation bugs in certain J2EE containers. If developers wish, they can reenable the use of TEI to significantly expand their available JSP development options. This feature can be enabled or disabled by changing the value of the <JATO package>.taglib.TagBase.USE_TEI constant.  
Added <jato:content> tag. Developers can use this tag to wrap an arbitrary section of JSP body content and fire display events for that section. This allows conditional suppression or tweaking of the content HTML as is possible with display fields.
 

Changed the default HTML escaping mode to true for the <jato:text>, <jato:getDisplayFieldValue>, and <jato:getModeFieldValue> tags. Applications that make use of these tags and rely on HTML escaping being disabled by default will need to add this attribute to ensure that the tag's value is not HTML escaped:

<jato:... escape="false" ... />

This change was necessary for security reasons.

Maybe

1.1.1 Change

Added escaping of quotes to tag attributes where necessary, to ensure that values including quotes don't cause rendering problems in the browser.

 

ViewBean & Request Dispatch Changes
Changes Requires 1.0 App Changes
Cleaned up exception handling such that users can throw CompleteRequestException during JSP rendering and the request will be properly aborted  
Improved general exception handling such that users get a much more predictable set of exceptions during event dispatching  
handle<child>Request() methods never needed a specific set of thrown exceptions in its signature. The documentation is now consistent with this fact.  
The RequestCompletionListener interface is implemented at the RequestHandlingViewBase & RequestHandlingTiledViewBase level, and pushes the notification of the request completion to any child views that are RequestCompletionListeners.  
The ModelManager now sends request complete notification to all RequestCompletionListeners before it sessions any sessionable models  
Old page URL specification method (...?page=...) is now fallback, and can (should) be disabled
Yes
Addressed issue with cross-module navigation. Now we require a module URL to be specified as a context param, or preload each module servlet (see the JATO Deployment Guide for more information)  
Added getModuleURL() method to the ViewBean interface. The implementation of this method in ViewBeanBase is marked final—it should never be overridden  
Removed getModuleURL() method from RequestContext interface  
Changed the timing of the initialization of the RequestContext  
Changed ApplicationServlet.checkBeanName() method to checkViewBeanClassName(). Also changed isCheckBeanNames() and setCheckBeanNames() methods to isCheckViewBeanClassNames() and setCheckViewBeanClassNames().  

Event Changes
Changes Requires 1.0 App Changes

Added new event onRequestHandlerNotSpecified to ApplicationServletBase.

By default, this event throws an exception. Developers can override to forward the request somewhere else (and then throw a CompleteRequestException)

 

Changed the name of the onBeforeHeader servlet event to onInitializeHandler and altered its signature. This change was undertaken because the "onBeforeHeader" name was semantically misleading.

1.0 Method Signature:

protected final void onBeforeHeader(HttpServletRequest request, HttpServletResponse response)

1.1 Method Signature

protected void onInitializeHandler(RequestContext requestContext, ViewBean viewBean) throws ServletException


Code from the deprectated onBeforeHeader() event should be moved to this event.

Yes

Changed servlet event signatures to take RequestContext instead of HttpServletRequest and HttpServletResponse objects.

These changes affect the following classes:

<JATO package>ApplicationServletBase
<Application package>.__applicaton__ServletBase
<Application package>.<__module__>.__module__Servlet

1.0 Event Signatures (These have been deprecated and marked final so that they cannot be accidentally overidden):

protected final void onAfterRequest(HttpServletRequest request,HttpServletResponse response)

protected final void onInitializeHandler(HttpServletRequest request, HttpServletResponse response, ViewBean viewBean)

protected final void onBeforeRequest(HttpServletRequest request, HttpServletResponse response)

protected final void onSessionTimeout(HttpServletRequest request, HttpServletResponse response)

protected final void onNewSession(HttpServletRequest request, HttpServletResponse response)

1.1 Event Signatures:

protected void onNewSession(RequestContext requestContext)

protected void onSessionTimeout(RequestContext requestContext)

protected void onInitializeHandler(RequestContext requestContext, ViewBean viewBean)

protected void onBeforeRequest(RequestContext requestContext)

protected void onAfterRequest(RequestContext requestContext)

Yes

Deprecated the onBeforeSessionUpdate event because it was considered superfluous. In JATO 1.0 this event and the onAfterRequest event fired successively with no significant intervening logic. A decision was made to eliminate the redundancy by preserving only the onAfterRequest event.

The deprecation occurs in <JATO package>ApplicationServletBase. Outdated events are marked final so that they cannot be accidentally overidden:

protected final void onBeforeSessionUpdate(HttpServletRequest request, HttpServletResponse response)

Adjustments may need to be made in the following classes:

<Application package>.__applicaton__ServletBase
<Application package>.<__module__>.__module__Servlet

Migrate any prior onBeforeSessionUpdate() event code to the onAfterRequest() event.

Yes

Changed the type of the field param in the onValidationException() event in ContainerViewBase.

1.0 Signature:

protected void onValidationException(ValueBasedView field, Object[] values, RuntimeException e)

1.1 Signature

protected void onValidationException(DisplayField field, Object[] values, RuntimeException e)

Yes

View Changes
Changes Requires 1.0 App Changes

Fixed check box state bug for first touch requests.

In JATO 1.0 there was a bug whereby the checkbox display field values were not being set properly for the first touch request. This was mistakenly being done as part of the special logic that needed to be in place to account for the way in which HTML only returns input values for checkboxes that are checked. This bug has been corrected in JATO 1.1

 

Added 3 DisplayField-related convenience methods to ContainerView (base interface for ViewBeans and TiledViews)

The following methods are all new to JATO 1.1:

public DisplayField getDisplayField(String name);
public Object getDisplayFieldValue(String name);
public void setDisplayFieldValue(String name, Object value);

 

Added 7 DisplayField-related convenience methods to ContainerViewBase (base class for ViewBeans and TiledViews)

public void setDisplayFieldValue(String name, boolean value)
public boolean getDisplayFieldBooleanValue(String name)

public void setDisplayFieldValue(String name, double value)
public double getDisplayFieldDoubleValue(String name)

public void setDisplayFieldValue(String name, int value)
public int getDisplayFieldIntValue(String name)

public String getDisplayFieldStringValue(String name)

 

Added 4 convenience methods to RequestHandlingTiledViewBase and RequestHandlingViewBase.

These convenience methods should allow developers to more simply access commonly needed data structures. In JATO 1.0, developers had to proxy these requests through the parent ViewBean.

  • public Model getModel(java.lang.Class modelClass
    Convenience method to make obtaining a model instance by its default name from the ModelManager easier. It is a simpler alternative to the following: getRequestContext().getModelManager().getModel(modelClass);
  • public ViewBean getViewBean(java.lang.Class viewBeanClass)
    Convenience method to make obtaining a view bean instance from the ViewBeanManager easier. It is a simpler alternative to the following: getRequestContext().getViewBeanManager().getViewBean(viewBeanClass)
  • public javax.servlet.http.HttpSession getSession()
    Convenience method to make obtaining the HttpSession instance from the RequestContext easier. It is a simpler alternative to the following: getRequestContext().getRequest().getSession(true)
  • public void appMessage(java.lang.String message)
    Convenience method to allow developers to write development time messages to the bottom of the HTML page. It a simpler alternative to the following: getRequestContext().getRequest().getMessageWriter().write("text")
 

Added a more formal notion of display fields and revised the view and view.html packages accordingly. These changes should not impact JATO 1.0 applications because the classes have for the most part simply moved package locations.

JATO 1.0 had display field constructs but they were still largely abstract special cases. Due to customer feedback, we now realize that display fields need to be first class specializations of Views, and that not supporting them in more concrete terms is a productivity liability. Therfore, we have made several changes to JATO to better support the notion of display fields. The changes are as follows.

Changes in the view package:

  • Added the DisplayField interface (this is a renamed version of the 1.0 view.ValueBasedView combined with the 1.0 view.html.DisplayField)
  • The following methods were removed from the DisplayField interface as part of the merging of ValueBasedView and DisplayField:

urlEncodedValue()
setDescriptor()

  • Added DisplayFieldDescriptor (this is same as 1.0 view.html.DisplayFieldDescriptor)
  • Added DisplayFieldImpl (this is a renamed version of the 1.0 view.html.DisplayFieldBase)  
  • Added BooleanDisplayField  interface (defines generic checkbox-like semantics for DisplayFields)
  • Added BooleanDisplayFieldImpl (implements BooleanDisplayField)

Changes in the view.html package (these classes/interfaces were moved to the view package):

  • Removed DisplayField (see Changes in the view package)
  • Removed DisplayFieldDescriptor (see Changes in the view package)
  • Removed DisplayFieldBase (see Changes in the view package)
  • Renamed Command to CommandField
  • Renamed CommandBase to CommandFieldBase
Maybe

Added defensive functionality so that HREFs and buttons will always render now, regardless of whether they have a value or not.

In JATO 1.0 an HREF or Button child that had a null value would not be rendered during the display cycle. In 1.1, HREF's and Button's with null values will still render. Users should generally use the defaultValue attribute on the tag to provide values if they need them in the automatically rendered situation.

 

Changed TiledViewBase.getPrimaryModel()/setPrimaryModel() method signatures to provide/require an instance of DatasetModel instead of just Model:

1.0 Signatures:

public Model getPrimaryModel()
public void setPrimaryModel(Model value)

1.1 Signatures:

public DatasetModel getPrimaryModel()
public void setPrimaryModel(DatasetModel value)

Maybe

The signatures of the following methods has changed to throw a ModelControlException. This should not generally affect existing applications:

TiledView.getChild(String,int)
ContainerView.mapRequestParameters(HttpServletRequest)

 

Added ability for developers to specify a qualified view path to the ContainerView.getChild(String name) method, using forward slashes ("/") as delimiters. All components in the path except the last must refer to a ContainerView or a derivative of ContainerView (such as TiledView). Both relative and absolute paths are possible. If a name path begins with a forward slash, the name is assumed to be relative to the root view (the ViewBean). If the path does not begin with a forward slash, the name is assumed to refer to a child relative to the current container. Two dots ("..") may be used to refer to the container that is the parent of the current container.

In the case of referencing children within a tiled view, developers can also specify the specific tile on which the following child appears. The syntax for this type of reference is .../<view>[<index>]/..., where <index> is the zero-based tiled index. WARNING: referencing a specific tile in this manner has side effects. The current tile location will be set to the referenced index; subsequent access to fields in the tiled view that do not specify a tile index will refer to the children of the last-referenced tile. These side effects may also affect tiled view iteration. Therefore, we generally recommend that developers avoid this style of reference when normal tiled view behavior (use of a current location) is sufficient.

Examples:

/header/orderList/customerName (absolute from root view)

orderList/customerName (relative to current container)

../footer/orderList/customerName (relative to parent)

../footer/orderList[3]/customerName (specific tile reference)

 

Added a convenience method to OptionList

public String getValue(int index)

 

Changed OptionList.getValueLabel(String value) to return null if value not found. In JATO 1.0 this method returned the empty string "" if the incoming value was not found in the list.

Maybe

1.1.1 Change

Changed the recommended order of code in <name>TiledView.beginDisplay() method.

The 1.0 code was mistakenly invoking resetTileIndex() before calling super.beginDisplay(). The recommendation is that the order of these two method invocations should be reversed in order to avoid any incorrect behavior.

The 1.0 Translation style:

resetTileIndex();
super.beginDisplay();

1.1 Translation style:

super.beginDisplay();
resetTileIndex();

 

Yes

Model Support Changes
Changes Requires 1.0 App Changes
Fixed stored procedure null param issue (bug #22)  

Added <JATO package>.model.uif package.

This package contains model classes that support remote invocation of procedures deployed in iAS Connectors.

 
Added <JATO package>.model.ContextualModel interface  

Added support for default model values.

Previously, the value provided in a display field constructor was only the initial value, which meant that it was pushed into the backing model one time when the field was instantiated. Subsequent access of that display field's value would return null if the backing model had changed location (a common situation if the backing model was a TiledView). Now, instances of DefaultModel use the first value set to a field as the default value for that field during subsequent accesses. If the actual value in the model field is null, the default value will be returned instead.

The use of default values can be disabled by calling the method DefaultModel.setUseDefaultValues(boolean).

 

Changed Model inheritance hierarchy. The Model hierarchy has been re-engineered for simplicity.

ExecutingModel is now the superclasses of other model subtypes.

RetrievingModel now extends ExecutingModel
UpdatingModel now extends ExecutingModel
InsertingModel now extends ExecutingModel
DeletingModel now extends ExecutingModel

This change formalizes the notion of an executing model, which is a model that defines an "execution" operation. The execution context provided to the ExecutingModel.execute() method now allows for an operation name, which can be used to specify to the model which operation to invoke. Alternatively, clients can call the more specific execution methods in one of the derivative execution model interfaces (for example, RetrievingModel.retrieve()).

Maybe

Changed the ModelExecutionContext hierarchy. The ModelExecutionContext hierarchy has been re-engineered for simplicity.

Permanently removed the following classes/interfaces:

Removed ExecutingModelExecutionContext
Removed ExecutingModelExecutionContextImpl
Removed ModifyingModelExecutionContext
Removed ModifyingModelExecutionContextImpl
Removed StoredProcModelExecutionContext

These implementations and interfaces were superfluous and caused much confusion. Instead, developers can now use one of the remaining contexts or simply pass in null if no additional execution information is required.

Any pre-existing StoredProcModelExecutionContext references should be changed to DatasetSQLModelExecutionContext.

Maybe
Changed <JATO package>.model..DefaultModel. It now implements <JATO package>.model.ContextualModel.  

Added methods to ResultSetModelBase to allow detection of the general position in the overall result set:

public boolean hasPreviousResults()



public boolean hasMoreResults()

These methods will return true after model execution if additional results are available before or after the current dataset. Developers can use these methods to perform actions like show or hide First/Previous/Next/Last Web action buttons.

NOTE: these methods are currently only available in descendents of ResultSetModelBase, such as QueryModelBase and StoredProcModelBase.

 

Fixed bug in which QueryModelBase and StoredProcModelBase were not closing statements that were allocated by default.

If a developer provided a Connection object in the execution context, but not a Statement object, the model would allocate a new Statement in order to execute the query. Although the models would release any default connections allocated during the execuction, they would not release the allocated Statement objects. This lead to a leak in database resources as long as the Statement's parent Connection remained open. These models now track whether they allocated a default Statement and then release it after execution.

 
Changed the default dataset size directive from DatasetModelExecutionContext.DATASET_SIZE_ALL_INCREMENTAL to DatasetModelExecutionContext.DATASET_SIZE_ALL_PREFETCH. This change removes the need to either provide a JDBC Connection object or change the directive before using an execution context created with a default constructor.  
Added QueryModelBase.get/setDefaultConnectionUser() and QueryModelBase.get/setDefaultConnectionPassword() methods. These methods allow developers to specify a username/password combination that the model will use when it allocates a default connection.  

1.1.1 Change

Fixed a bug affecting the number of rows returned by the ResultSetModelBase.getSize() method on the submit cycle. If the SQL model was bound to a tiled view, the submitting of the data back to the application would succeed, but the number of rows reported was always zero. This bug also affected iteration through the rows of subclasses of ResultSetModel during the submit cycle.

 

1.1.1 Change

Fixed improper serialization bug in iAS when serializing WHERE criteria objects for QueryModels

 

Miscellaneous Changes
Changes Requires 1.0 App Changes
Fixed runtime include of full JATO pages (translation-time includes of other JATO pages are not supported)  

Changed the preferred order and content of the <useBean> and the <useViewBean> tags in JATO JSPs.

1.0 Order and Content

<jsp:useBean id="viewBean" class="="__application__.__module__.__page__ViewBean scope="request"></jsp:useBean>
<jato:useViewBean className="__application__.__module__.__page__ViewBean">

1.1 Order and Content

<jato:useViewBean className="__application__.__module__.__page__ViewBean">
<jsp:useBean id="viewBean" type="__application__.__module__.__page__ViewBean"></jsp:useBean>

The new 1.1 style is required to allow runtime inclusion of JATO pages. The1.0 order can be retained in any already translated JSP's as long as they do not attempt any runtime inclusion of other JATO pages

Maybe
Fixed command dispatching within nested tiled views  
Added JATO version tag generation  
Added interface for container exceptions called RootCauseException. This will help users and the framework detect when an exception wraps another.  
Added transparent support for cookieless operation. JATO apps will now maintain session even if cookie support in the browser is disabled.  
Changed HtmlUtil to make formatting HTML output more robust. It now checks for empty strings on numeric formatting.  
Added capability to StringTokenizer2 to ignore string case during tokenizing and replace operations