A SERVICE OF

logo

28 Chapter 5. WAF Component: Presentation
5. Fire the control event.
When a client sends a request to a Bebop page (e.g. a mouse-click on a tab); only one component
receives the request. This triggers the respond method of that component only; no other compo-
nents response methods are involved.
Ifthe request state isdeemed valid, the selected component hasthe opportunity torespond, perhaps
changing the request state and thus the outcome of further processing.
Acontrol event handles formsubmission, control links,and hasinfluence on thestate and visibility
before any output is produced.
6. Fire the action event.
The action event is anopportunity for anycomponent to run code beforethe response is committed
and after the controlling component has responded.
Any component may listen and edit state and visibility before any output is produced. This is the
last opportunity to edit before XML is written out.
7. Generate XML.
The components generate the XML. They write to the document created in the first step. Each
component generates its own semantic XML (such as XUL, Mozilla’s presentation-based cross-
platform markup language) and also delegates to its children. A DOM is built.
8. Transform the XML.
The XMLdocument is transformed with anXSLT stylesheet and sentback to the client inthe form
of HTML and CSS.
By following this method, it is easy to define and maintain a style and layout uniformity. A devel-
oper or designer can drop a different XSLT into the last step in a page request cycle.
9. The client receives the transformed results of the page request.
5.4.2. JSP Integration with Bebop
JSP is integrated with Bebop components (XML sources) and XSLT by using a JSP tag library to
allow the use of Bebop components in an otherwise standard JSP. The JSP tag libraries accomplish
this by performing transformations on the XML document produced by a Bebop page. This JSP tag
library also directs the generation of output by rendering the resulting XML document through XSLT,
so that the included components displayed in a JSP are styled with the standard template rules that are
used on the rest of the site. See Appendix A Bebop Tag Library Reference.
Java developers can alsoconstruct their Bebop pages inJSP.The tag library fordeclaring Bebop pages
isseparate from theone fordisplaying Bebop components,but they areintended to work together. This
is different from using a Bebop component inside of JSP. In this instance, the specific Bebop JSP tags
takeover JSP similar to writing and controlling a servlet.
There are several motivating factors for integrating JSP with Bebop. First, laying out pages using JSP
integration will allow web developers who are notJava programmersto use third-party webpublishing
tools (Dreamweaver, etc.) to alter the layout of pages, add new components to an existing page, edit
form field labels or prompts, etc. It would also be possible to make completely new pages with JSP
that display components from existing Bebop pages.
Second, JSP is a convenience for Java developers creating Bebop pages, because JSP shortens the
development cycle for individual pages by eliminating the need for a manual recompile and server
restart when a page is changed.
The overall request pipeline for constructing a page with Bebop and displaying it with JSP follows
this sequence: