Simple Examples For JSP Tags

Example Description
Hello

The "Hello" example is a JSP page for printing the price of a property. It demonstrates how to use the form and display tag to display the content of an element.

Display

The "Display" example is similar to the "Hello" example since the JSP page uses exactly the same kind of tags; however it is more complex: Instead of showing only the content of one element, it lists the content of multiple elements within a table.

Create

The "Create" example shows an HTML-form for entering the characteristics of a new Property. When using the submit button of the form, the new document is stored within Tamino. The result of this action is shown in the page, the form refers to. Herein you learn how to use tags for editing content of documents and how to integrate buttons to commit an action.

Browse

The "Browse" example shows how to create a table which lists a set of Properties. The set contains all Properties remaining in a state beginning with the letter N (e.g. NV for Nevada or NM for New Mexico).

Browse with Navigation

Within the first "Browse" example you will receive the complete list of a query. This visualization is not appropriate for large document sets. You will want to see a sequence of pages where each page shows a fix number of documents instead. Furthermore, the set should be sorted. This example uses the navigation buttons "next" and "previous" to browse the result set of a query.

Browse of Two Lists

The 'BrowseTwoLists' example shows that its possible to have two navigable lists of documents on one page. The first list all property documents within states starting with an 'N', the second contains documents whose state starts with 'C'.

Modify

The "Modify" example consists of four JSP pages. The first page lists ten existing Property documents (if available) where you can select one. For the selected document the conent is displayed and you can change to the "modify" page. The following "modify" page allows you to change its content. When you commit your changes you will see the result within the following "display" page.

Delete

As the 'Modify' example the 'Delete' example consists of four JSP pages. The first page lists existing Property documents. You can select one of these documents for displaying its content. Then you can delete the Property. The final page allows you to commit the deletion or to abandon it.

Query

For constructing a set of documents, the former examples used directcommands of the type 'query' which were executed of the JSP engine if it detects the command within a JSP page, e.g.

  • <bdm:directcommand type="query" schema="Property" queryparm="Address/State~=N*" />

  • <bdm:directcommand type="query" schema="Property" queryparm="ino:id>=1" />

The 'Query' example shows how to construct a set of documents by input fields of an HTML form.

If

Within the "If" example a page lists max. 1000 existing Property documents. While "Price" and "Category" are displayed for each document, the "Description" of a document is displayed only if the number of bathrooms is two. This example demonstrates the use of the if tag.

Loop

Within this 'Loop' example the list of contact persons for a set of properties is shown using the loop tag.

LoopModify

'LoopModify' introduces tags that allow you to modify the conatct list of one document. It consists of three JSP pages. The first page displays a document, the second allows you to modify the document and the third allows you to modify of a single entry of the list of contact persons. As extension to the former "loop" example, it explains the following tags

  • elementaction which allows you to select an list entry for the next page,
  • link to process an action without effect to the database.
LoopInsDel

'LoopInsDel' adds the aspect of modifying the list by adding new entries and deleting existing ones (while "LoopModify" showed only to modify existing entries of a list). The example includes three JSP pages: the first page displays a document, the second allows you to modify the document (adding/removing list entries) and the third allows you to enter new entries. The example does not introduce new tags, but new options for the tags elementaction and link.

Loop In Browse

'Loop In Browse' shows how to display a list of ContactPersons within list of Property documents. For each document maximal two contact persons are displayed. If the document contains more than two contacts, navigation links are used to display the next or previous contact entries.

Loop In Loop

'LoopInLoop' demonstrates nested loops within one page. The first page loads an existing document from the patient schema as business document and lists the 'examinations' for a patient. An examination contains files and remarks which are displayed as inner loops. When clicking on the modify button you comes to the next page, which lists the same content, but allows you to add or remove examination as well as changing an examination entry by modifying its number of remarks and files data.

ChoiceDisplay

"ChoiceDisplay" shows the handling of choices. The first page loads an existing instance from the patient schema as business document. It makes this instance modifiable and shows the selected choice of the therapy group. When you click on the top link you get to a second page ChoiceModify where a new choice selection can be choosen. The schema of patient allows for tag therapy one of the three choices: medication, physical or other.

Select

"Select" shows how to fill a select element with entries. In this example the displayed values are mapped to transmitted values.

Count

"Count" shows how to count the occurences of a specific value within a set of documents.

Top of page