October 1, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Introducing Java Page Flow Architecture

  • August 31, 2005
  • By Kunal Mittal & Srinivas Kanchanavally
  • Send Email »
  • More Articles »

NetUI-data

The NetUI-data tag library is used to bind data from forms and the controller to the JSP. It allows you to quickly display lists of data (such as search results). See Table 2, which shows the Javadocs information about this tag library.

Table 2. NetUI-data Tag Library

Tag Description
<netui-data:anchorColumn>  
<netui-data:callMethod> Calls methods on any Java classes
<netui-data:callPageFlow> Calls methods on the controller file (which is a JPF file) in the same directory as the JSP
<netui-data:caption>  
<netui-data:cellRepeater> Renders individual cells of an HTML table
<netui-data:columns>  
<netui-data:configurePager>  
<netui-data:dataGrid>  
<netui-data:declareBundle> Declares a java.util.ResourceBundle as a source for displaying internationalized messages
<netui-data:declarePageInput> Declares variables that are passed from the controller file to the JSP
<netui-data:footer>  
<netui-data:getData> Evaluates an expression and places the result in the javax.servlet.jsp.PageContext object, where the data is available to JSP scriptlets
<netui-data:imageColumn>  
<netui-data:literalColumn>  
<netui-data:message> Provides a message schema, which can be parameterized to construct customizable messages
<netui-data:messageArg> Provides a parameter value to a message schema
<netui-data:methodParameter> Provides an argument to a method-calling tag
<netui-data:pad> Sets the number of items rendered by a tag
<netui-data:renderPager>  
<netui-data:repeater> Iterates over a data set to render it as HTML
<netui-data:repeaterFooter> Renders the footer of a Repeater tag
<netui-data:repeaterHeader> Renders the header of a Repeater tag
<netui-data:repeaterItem> Renders an individual item in the data set as it's iterated over by the Repeater tag
<netui-data:serializeXML> Serializes an XMLBean into the output of a JSP in order to move data to the browser for data binding

NetUI-template

The NetUI-template tag library is used to create subsections (or templates) from your JSPs. See Table 3, which displays the Javadocs information about this tag library.

Table 3. NetUI-template Tag Library

Tag Description
<netui-template:attribute> Defines a property placeholder within a template
<netui-template:divPanel> Creates an HTML <div> tag that may contain additional tags
<netui-template:includeSection> Defines a content placeholder within a template
<netui-template:section> Sets HTML content inside placeholders defined by an IncludeSection tag
<netui-template:setAttribute> Sets a property value in a template page
<netui-template:template> Points a content page at its template page

You've just seen a brief overview of Page Flows and NetUI. Now let's see how all this plays together.

Reviewing Page Flow Architecture

The best way to explain the overall architecture of Page Flows and NetUI is to map these to the standard MVC model, as shown in Figure 2.



Click here for a larger image.

Figure 2. MVC architecture of Page Flows and NetUI

Think of the controller bucket as being the Page Flow controllers. If you're familiar with Struts, this bucket is filled by Struts actions. The view is a collection of JSPs and some tag libraries, in this case the NetUI tag libraries. In Struts, it would be the Struts tag libraries. The model layer is not really predetermined by Page Flows. As part of the Apache Beehive project, there is a technology called Controls. This is a model layer technology.

However, for purposes of Java Page Flows, the model layer could be anything. You could obviously use Controls. Or, you could have a set of Java classes that serve as business delegates, which then interact with your EJBs, DAOs, and other classes.

Throughout the article, I've alluded to the real advantages of Page Flows over Struts:

  • Ease of use: The main development savings between Struts and Page Flows is the JSR 175 metadata support. While developing Page Flows, you don't need to manually maintain the struts-config files.
  • Data binding: With Page Flows and NetUI, you get automatic data binding between the form variables and the form fields in the JSP.
  • Exception handling: This goes back to the annotations. You can define how all your exceptions get handled using the annotations. As a best practice, we recommend always catching the Exception class at the Page Flow level. This allows you to handle any otherwise uncaught exceptions.
  • Nested Page Flows: The whole concept of nested Page Flows is new.
  • State management: Page Flows automatically maintain state. This feature is even more important if you're working with portals.
  • Portal use: Page Flows were originally developed for portal development. Thus, a lot of the features are targeted toward portal projects.
  • Service orientation: The integration of Page Flows with Java Controls leads to a more service-oriented approach for application development.

Conclusion

In this article, you saw the basic components that make up Java Page Flows and NetUI. You also looked at a quick example and then drilled down into the overall architecture of these technologies.

About the Authors

Kunal Mittal is a consultant specializing in Java technology, the J2EE platform, Web Services, and SOA technologies. He has coauthored and contributed to several books on these topics. Kunal works as an applications architect for the Domestic TV division of Sony Pictures Entertainment. In his spare time, he does consulting gigs for start-ups in the SOA space and for large companies looking to implement an SOA initiative. You can contact Kunal through his Web site at www.soaconsultant.com.

Srinivas Kanchanavally is a Software Architect with CoreObjects Software Inc. in Los Angeles, California. He has an in-depth under-standing of Java and J2EE. He also has vast experience designing large-scale J2EE application architectures. Srini has worked with Java, J2EE, Struts, WebLogic, and WebLogic Portal on client projects. And he has several years of experience working with various open-source frame-works and tools such as JBoss/Tomcat, MySQL, JUnit, and HTTPUnit.

Source of This Material

Pro Apache Beehive
By Kunal Mittal and Srinivas Kanchanavally



Published: August, 2005, Paperback: 240 pages
Published by Apress Press
ISBN: 1-59059-515-7
Retail price: $39.99
This material is from Chapter 4 of the book.





Page 3 of 3



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel