• No results found

Table of InternetBeans tags

In document Web Application Developer s Guide (Page 90-93)

The tags which are included in the InternetBeans Express tag library are described in the table below. The attributes shown in bold type are required.

Table 7.2 InternetBeans Express tags

Tag name Description Attributes

database Defines a DataExpress

Database

id — text used to identify this database

driver — driver property of Database

url — url property of Database

• username — the username for the database • password — the password for the database

query Defines a

DataExpress

QueryDataSet

id — text used to identify this query

• database — identifies the database to which this query belongs. This isn’t required because it’s implied if the query tag is nested within the database tag. If the query tag isn’t nested within the database tag, this attribute needs to be specified.

statement — the SQL statement executed by this query.

control Defines an InternetBeans Express

IxControl

• id — text used to identify this control

• tupleModel — the tupleModel for this control • dataSet — identifies the dataset (query) to which this control is connected. Either the

dataSet or the tupleModel is required, but you can’t have both.

columnName — identifies the columnName to which this control is connected.

image Defines an

InternetBeans

Express IxImage

• id — text used to identify this image

• tupleModel — the tupleModel for this control • dataSet — identifies the dataset (query) to which this image is connected. Either the

dataSet or the tupleModel is required, but you can’t have both.

columnName — identifies the columnName to which this image is connected.

submit Defines an

InternetBeans Express

IxSubmitButton

• id — text used to identify this submit button

methodName — name of the method which will be executed when this button is pressed.

table Defines an

InternetBeans

Express IxTable

• id — text used to identify this table

• dataSet — identifies the dataset (query) to which this table is connected.

• tableModel — the data model for this table.

Either the dataSet or the tableModel is required,

U s i n g I n t e r n e t B e a n s E x p r e s s 7-9

U s i n g I n t e r n e t B e a n s E x p r e s s w i t h J S P s There are only six tags in the InternetBeans Express tag library, yet there are seventeen InternetBeans components. This may seem like a major limitation, but it’s really not. The control tag maps to an IxControl, which delegates to all the other control-specific InternetBeans. The only

InternetBeans which aren’t covered by the tag library are IxSpan and IxLink. Neither of these are useful in a JSP, because you can just as easily use your own JSP expression scriptlet to do the same thing.

Of course, it’s also possible to use InternetBeans directly, just like any other bean or Java class. Using the tag library is just much more convenient and it does a few extra things for you (like maintaining the session state for data entry).

Format of internetbeans.tld

It is useful to know that you can always look at the source of the internetbeans.tld file for hints about use of the various tags. To do this, open it in JBuilder’s editor. This file cannot (and should not) be modified. The internetbeans.tld file is available in internetbeans.jar. You don’t need to be able to view the contents of internetbeans.tld in order to use its tags in your JSP, but if you want to view the internetbeans.tld file in the editor, you need to do the extra step of adding it to your project. To do this:

1 Click the Add Files/Packages button on the toolbar above the project pane.

2 In your project directory, find internetbeans.jar. It will be in the WEB-INF/ lib directory of your WebApp.

3 In the directory tree, click to expand the internetbeans.jar node.

4 Under com.borland.internetbeans.taglib, locate the internetbeans.tld file and select it.

5 Click OK to add the file to your project.

The information at the very top of the internetbeans.tld file is of little interest. The information that is useful to understand begins with the first <tag> tag inside the file. Each <tag> tag represents an InternetBeans tag definition.

U s i n g I n t e r n e t B e a n s E x p r e s s w i t h J S P s

At the beginning of each tag definition, you see a <name> tag which indicates the name of the tag. The first one is the database tag. Nested within each tag definition, you will also see <tagclass>, <info>, and <attribute> tags. For an example of how an InternetBeans tag definition looks, see the fragment of the internetbeans.tld file which defines the submit tag below:

<tag>

<name>submit</name>

<tagclass>com.borland.internetbeans.taglib.SubmitTag</tagclass> <bodycontent>JSP</bodycontent>

<info>Submit button or submit image control</info> <attribute> <name>id</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>methodName</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> </tag>

The <tagclass> tag indicates the name of the class within the com.borland.internetbeans.taglib package which is responsible for

interpreting this InternetBeans tag when it is used in a JSP. The <info> tag supplies a description of the InternetBeans tag.

The <attribute> tag describes an attribute for an InternetBeans tag. There is one <attribute> tag for each attribute. These can be thought of as the component’s properties. Nested within the <attribute> tag you will see these properties. Each property has a name, a boolean value indicating whether or not it is a required property, and a boolean value indicating whether or not its value can be set using a java expression. The name is found within the <name> tag, the <required> tag indicates whether or not the property is required, and the <rtexprvalue> tag indicates whether or not the property can be set using a java expression. Those properties which can’t be set using an expression require a literal value.

U s i n g t h e S t r u t s f r a m e w o r k i n J B u i l d e r 8-1

C h a p t e r

8

Chapter8

Using the Struts framework

In document Web Application Developer s Guide (Page 90-93)