dWebSpec Dictionary
CONTEXT: descriptors->element->conversion-type




All Details Standard Only Platform Only
Structured Web info and helpTechnologies
 Home Page
 Product Page
 Download Page
 Feedback
Javascript Tree Menu

Results for:

 element.conversion-type 
Prev  Topic  Next

The standard html entries are presented as strings on the page. However, their values could be bound to other types of objects and primitives. These could be numeric, date or other types. The conversion type specification allows for the designation of such types. The dWebSpec standard types are listed below:

  • string (default)
  • byte
  • short
  • integer
  • long
  • float
  • double
  • date
  • collections

The standard types would ensure platform independence. However, if such independence is not needed, or else as specification matures, platform specific or custom types could or should be included.

 Struts 1.x  

On the Struts platform, the form-beans are the transfer objects. Struts uses Jakarta Beans Utilities to auto-populate the form beans, and extract data from them; this why the names and properties are reflected in the implementation tags.

As such, the conversion type specification for an element, is actually the attribute type within the form bean.

The conversion types are meant to ensure that the purely string web entries could be converted to the attributes of the models, which the form beans stand as proxies.

As could be seen in the overview section, dWebSpec conversion types are similar to Java types, or in general similar to languages that evolved form C/C++.

For implementation on the Struts platform, the specification would be reflected in the implementation of the form bean.

It is more typical, that the form-beans (transfer objects) are designed as objects that mirror the model objects. As such these objects would be implemented on the server side.

There are cases like login pages, that that their implementations could start from the descriptor specifications. Struts provides a means of preparing XML entries from the name and conversion types of the elements. These are called DynaForms.

The entry in the Struts configuration for standard form bean object is as follows.

  <form-bean name="categoryForm" type="com.example.CategoryForm"/>
  

The reflect the fact fact that this object would be part of the a library, and that a reference to it is being registered.

For DynaForms, the field definitions would be included in Struts configuration as shown below:

  <form-bean name="categoryForm"
    	type="org.apache.struts.validator.DynaValidatorActionForm">
    <form-property name="categoryId" type="java.lang.String"/>
    <form-property name="name" type="java.lang.String"/>
    <form-property name="description" type="java.lang.String"/>
  </form-bean>
  

This would represent the form bean implementation.

CONVERSION TYPE

Standard Types

 

Java Types

string (default)

 

String

byte

 

byte

short

 

short

integer

 

int

long

 

long

float

 

float

double

 

double

date

 

Date

boolean

 

boolean

 In specifying types, Struts included some additional types for credit card, email and URL validations.

Prev Next