Java Reference
In-Depth Information
Tim Says. . .
Input Tags Mimic the HTML Tags As Closely As Possible
Stripes input tags try very hard to mimic their HTML counterparts
as closely as possible. This means that, in general, if you already
know how to use HTML input , select , textarea , form tags, and so
on, then you should feel right at home with the Stripes tags.
Even the class attribute for specifying CSS classes is the same.
There are, of course, some deviations. First is one you may
have already noticed—where in HTML you would write <input
type="X"> , in Stripes you write <s:X> . For example, you would
write <s:radio> instead of <input type="radio"> . The main reason
for doing this is to make your life easier—each of the differ-
ent input types has different required and permitted attributes.
Making them separate tags allows the set of fields to be val-
idated at compile time and checked by most popular IDEs.
Keeping them as one tag would lead to unhelpful code com-
pletion and more runtime errors.
In addition, several Stripes tags add attributes to the list sup-
ported by their HTML equivalents. This is done to allow you to
activate additional functionality offered by Stripes. For exam-
ple, the beanclass attribute on the Stripes form tag allows you
to specify the action bean class to target instead of having
to specify the URL, and the format* attributes on the input tags
allow you to specify how values should be formatted when writ-
ten to the page.
Lastly, as Freddy discusses, there are several “helper” tags that
have no equivalent in HTML that help produce things such as
lists of options from collections and enumerations.
 
 
Search WWH ::




Custom Search