Before You Begin

Building Web Components provides essential information for anyone involved in the creation of web applications with Javatrademark 2 Platform, Enterprise Edition (J2EEtrademark) web components. It is part of the Fortetrademark for Javatrademark 4 programming series. This book focuses on web application development in the context of the J2EE and its supporting technologies. These technologies include Java servlets and JavaServer Pagestrademark (JSPtrademark).

This book introduces web applications and provides suggestions for their structure. It describes the work flow of developing a web application. The book proposes design practices and provides pointers to suggested structures and frameworks for scalable, maintainable web applications. It places these concepts within the context of the Forte for Java 4 IDE with discussions of the creation of JSP pages and servlets, coding, testing, debugging, and deployment. The book discusses new features such as the HTTP monitor tool and filter technology.

In particular, this book describes how web applications typically use JSP pages, Java servlets, JSP tag libraries, and supporting classes and files. Web applications might use persistent data, for example, a database. They could be independent applications with features managed by a web container. Or, they might provide a user interface while depending on components in a J2EE Enterprise JavaBeans (EJBtrademark) container for other services. Such services might include execution of business logic and access to persistent data.

You can create the examples in this book in the environments listed in the release notes on the following web site:

http://forte.sun.com/ffj/documentation/index.html

Screen shots vary slightly from one platform to another. You should have no trouble translating the slight differences to your platform. Although almost all procedures use the Fortetrademark for Javatrademark 4 user interface, occasionally you might be instructed to enter a command at the command line. Here too, there are slight differences from one platform to another. For example, a Microsoft Windows command might look like this:

c:\>cd MyWorkDir\MyPackage

To translate for UNIX® or Linux environments, simply change the prompt and use forward slashes:

% cd MyWorkDir/MyPackage


Who Should Use the Book

The book assumes you are a web application developer or a web application designer. A web application developer writes the application code. A web application designer specifies how users interact with an application, chooses interface components, and arranges them in a set of views. Unless otherwise stated, this book uses the term web application to refer to a J2EE web application. The web application developer might or might not be the same person as the web application designer. In either case, it is assumed you have a general knowledge of Java programming, JSP page programming, and HTML coding. Information in this book might also prove useful for any professionals who participate in the creation of applications based on web components. Such professionals might include technical writers, graphic artists, production and marketing specialists, and testers. This book presents the ways in which web application development work flow is facilitated by the use of the IDE. It provides a context in which to use this productivity tool.


Before You Read This Book

The development of web applications differs markedly from that of traditional Java applications. It requires an understanding of several different technologies, including:

  • HTML syntax
  • XML syntax
  • Javatrademark programming language
  • Java Servlet syntax
  • JavaServer Pagestrademark syntax
  • HTTP protocol
  • Web server concepts
  • Security issues

This book enables you to use your current skills. It also provides you with references to help you become productive in the building of web applications with the IDE.

This book also requires a knowledge of J2EE concepts, as described in the following resources:

The Forte for Java 4, Community Edition Tutorial can be downloaded from the Developer Resources web site. To gain access to the tutorial, choose Help, then Learning, then Examples, then Tutorials from the IDE's main menu.

The J2EE Tutorial describes the process of developing web applications. Visit the web site at:

http://java.sun.com/j2ee/tutorial/

The Web Apps tutorial from the Web Services Developer pack provides helpful background. It could prove useful as a reference while reading this book. Visit this web site to download the tutorial:

http://java.sun.com/webservices/docs/ea2/tutorial/index.html



Note - Sun is not responsible for the availability of third-party web sites mentioned in this document and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods, or services available on or through any such sites or resources.




What Is in This Book

Building Web Components contains the following information:

Chapter 1 provides an introduction to web applications and the challenges they present to developers. It describes the ways that the IDE helps the developer face those challenges.

Chapter 2 discusses the structure of web applications. It includes an overview of the core J2EE technologies used in building the components of web applications.

Chapter 3 gives an overview of useful design patterns and frameworks for web applications.

Chapter 4 describes the process of developing your own web application using the IDE.

Chapter 5 provides details on the process of executing, debugging, and deploying your web application using the IDE.

The Glossary defines important words and phrases found in the book. Glossary terms appear in italics throughout the book.


What Is Not in This Book

This book is intended to provide sufficient information to get you started using the IDE as a productivity tool. However, it is not designed as a tutorial. The book is neither a comprehensive reference, nor does it supply all possible designs for a web application. It is not a visual design guide. Nor is the focus on developing the J2EE web tier. The book does not delve into how to develop EJB components. See Useful References for suggested readings. See Before You Read This Book for references to tutorials regarding the development of web applications.


Useful References

This section provides the names of references you might find helpful when reading this book.

This volume covers topics related to web application design and implementation:

Alur, Deepak, Crupi, John, and Malks, Dan, Core J2EE Patterns, Sun Microsystems Press, Prentice Hall, 2001. This excellent book on web application architecture and models provides solutions, including J2EE-based answers, to problems in context. It reflects the collective experience of Java architects and the Sun Java Center.

Valuable Websites

Here is a selection of websites dealing with web application technologies:

  • The Source for Java Technology provides a wealth of information on web component technologies. Topics include products and APIs, access to the Developer Connection, documentation and training, and online support. It also supplies community discussion, industry news, marketplace solutions, and case studies. Available at http://java.sun.com
  • JSP Insider is a JavaServer Page website offering design information, articles, code, links to other websites, news stories, and book reviews. Available at http://www.jspinsider.com
  • The JSP Resource Index is a place to find tutorials, scripts, and even job listings. Available at http://www.JSPin.com
  • The Jakarta Project supplies commercial-quality server solutions based on the Java platform that are developed in an open and cooperative fashion. Jakarta is the overall project name for many subprojects, including the Jakarta tag libraries and the Tomcat server. Available at http://jakarta.apache.org


Typographic Conventions

Typeface

Meaning

Examples

AaBbCc123

The names of commands, files, and directories; on-screen computer output

Edit your.login file.

Use ls -a to list all files.

% You have mail.

AaBbCc123

What you type, when contrasted with on-screen computer output

% su

Password:

AaBbCc123

Book titles, new words or terms, words to be emphasized

Read Chapter 6 in the User's Guide.

These are called class options.

You must be superuser to do this.

AaBbCc123

Command-line variable; replace with a real name or value

To delete a file, type rm filename.



Related Documentation

Forte for Java 4 documentation includes books delivered in Acrobat Reader (PDF) format, online help, readme files of example applications, and Javadoctrademark documentation.

Documentation Available Online

The documents in this section are available from the Forte for Java 4 portal and the docs.sun.comSM web site.

The documentation link of the Forte for Java Developer Resources portal is at http://forte.sun.com/ffj/documentation/. The docs.sun.com web site is at http://docs.sun.com.

  • Release notes (HTML format)
Available for each Forte for Java 4 edition. Describe last-minute release changes and technical notes.
  • Forte for Java 4 Getting Started Guide (PDF format) - Community Edition part no. 816-4062-10, Enterprise Edition part no. 816-4063-10
Available for each Forte for Java 4 edition. Describes how to install the Forte for Java 4 product on each supported platform and includes other pertinent information, such as system requirements, upgrade instructions, web server and application server installation instructions, command-line switches, installed subdirectories, Javadoc setup, database integration, and information on how to use the Update Center.
  • The Forte for Java 4 Programming series (PDF format)
This series provides in-depth information on how to use various Forte for Java 4 features to develop well-formed J2EE applications.
    • Building Web Components - part no. 816-4337-10
Describes how to build a web application as a J2EE web module using JSP pages, servlets, tag libraries, and supporting classes and files.
    • Building J2EE Applications With Forte for Java - part no. 816-4061-10
Describes how to assemble EJB modules and web modules into a J2EE application, and how to deploy and run a J2EE application.
    • Building Enterprise JavaBeans Components - part no. 816-4060-10
Describes how to build EJB components, that is, session beans and entity beans with container-managed or bean-managed persistence, using the Forte for Java 4 EJB Builder wizard and other components of the IDE.
    • Building Web Services - part no. 816-4059-10
Describes how to use the tools provided by the Web Services module to build web services. Web services are application business services published as Extensible Markup Language (XML) documents delivered over HTTP connections.
    • Using Java DataBase Connectivity - part no. 816-4685-10
Describes how to use the JDBC productivity enhancement tools of the Forte for Java 4 IDE, including how to use them to create a JDBC application.
  • Forte for Java 4 tutorials (PDF format)
You can also find the completed tutorial applications at http://forte.sun.com/ffj/documentation/
tutorialsandexamples.html
    • Forte for Java 4, Community Edition Tutorial - part no. 816-4058-10
Provides step-by-step instructions for building a simple J2EE web application using Forte for Java 4, Community Edition tools.
    • Forte for Java 4, Enterprise Edition Tutorial - part no. 816-4057-10
Provides step-by-step instructions for building an application using EJB components and Web Services technology.

The docs.sun.com web site (http://docs.sun.com) enables you to read, print, and buy Sun Microsystems manuals through the Internet. If you cannot find a manual, see the documentation index installed with the product on your local system or network.

Online Help

Online help is available inside the Forte for Java 4 development environment. You can access help by pressing the help key (Help in a Solaris environment, F1 on Microsoft Windows and Linux), or by choosing Help right arrow Contents. Either action displays a list of help topics and a search facility.

Examples

You can download several examples that illustrate a particular Forte for Java 4 feature, as well as the source files for the tutorial applications from the Developer Resources portal, at:

http://forte.sun.com/ffj/documentation/tutorialsandexamples.html

Javadoc Documentation

Javadoc documentation is available within the IDE for many Forte for Java 4 modules. Refer to the release notes for instructions on installing this documentation. When you start the IDE, you can access this Javadoc documentation within the Javadoc pane of the Explorer.


Sun Welcomes Your Comments

Sun is interested in improving its documentation and welcomes your comments and suggestions. Email your comments to Sun at this address:

docfeedback@sun.com

Please include the part number (816-4337) of your document in the subject line of your email.