Posted By:
jim_conallen
Posted On:
Monday, May 14, 2001 08:39 AM
Parameters
There are two principal ways to model parameters
being passed from a HTML source on the client to a <
>
on the server. The first is to put them in a tag value, called parameters. For
example:
+------------------+ +--------------------+
| <> | <> 0..n | <> |
| Catalog |----------------------------->| Product.jsp |
+------------------+ {prameters="prodid"} +--------------------+
|
<> |
|
|
V
+--------------------+
| <> |
| Product.html |
+--------------------+
In the above example the link from Catalog to Product.jsp indicates that a standard
anchor tag is used (i.e. ) and that appended to the url is the parameter
prodid. At design time this parameter is not given any value, since it is likely to
be runtime generated thing. Also note that in this catalog page there are potentially
many links to product pages, all with potentially different prodid params.
Multiple parameters can be passed simply be adding them in the string just as you
would append them to the url. For example if the parameters tag value was
"action=add&prodid&qty". It would indicate that at design time the parameter action
was always set to add, and the values for prodid and qty are either not specified, or are
specified at runtime.
If the parameters being passed to the server are more complex, and where it might be useful
to document heavily each and every one. Then you might want to model them as and association
class on the <> association. This lets you not only specific all the parameters,
but gives you an oppertuity to specify datatypes, and default values for each. This of course is
overkill for most simple parameter usages, but is handy for those special occasions.
+------------------+ +--------------------+
| <> | <> | <> |
| HomeMonitor |----------------------------->| HomeControl.jsp |
+------------------+ +--------------------+
+-------------------+
| <> |
| ControlInfo |
+-------------------+
| homeid : long |
| deviceid : long |
| action : enum |
| value : string |
+-------------------+
Beans
Modeling bean usage in a JSP begins with a <