![Red Hat Application Server Manual Download Page 165](http://html.mh-extra.com/html/red-hat/application-server/application-server_manual_1427406165.webp)
Chapter 16.
Developing Web Components
This chapter is for the Web Component provider; that is, the person in charge of developing the web
components on the server side.
16.1. Introduction to Web Component Development
A Web Component is a generic term that denotes both JSP pages and servlets. Web components are
packaged in a
.war
file and can be deployed in a JOnAS server via the
web
service. Web components
can be integrated in a J2EE application by packing the
.war
file in an
.ear
file (refer to Chapter 22
Defining the EAR Deployment Descriptor
).
The JOnAS distribution includes a Web application example called The EarSample example (see
http://www.objectweb.org/jonas/current/examples/earsample).
The directory structure of this application is as follows:
etc/xml
Contains the
web.xml
file that describes
the web application.
etc/resources/web
Contains HTML pages and images; JSP
pages can also be placed here.
src/org/objectweb/earsample/servlets
Servlet sources
src/org/objectweb/earsample/beans
Beans sources
If beans from another application will be used, the
bean
directory is not needed.
16.2. The JSP Pages
Java Server Pages (JSP) is a technology that allows regular, static HTML, to be mixed with
dynamically-generated HTML written in Java programming language for encapsulating the logic that
generates the content for the page. Refer to the Java Server Pages (http://java.sun.com/products/jsp/)
and the
Quickstart Guide
(http://java.sun.com/products/jsp/docs.html) for more details.
16.2.1. Example
The following example shows a sample JSP page that lists the content of a cart.
!-- Get the session --
%@ page session="true" %
!-- The import to use --
%@ page import="java.util.Enumeration" %
%@ page import="java.util.Vector"
%
html
body bgcolor="white"
h1
Content of your cart
/h1
br
table
!-- The header of the table --
tr bgcolor="black"
Summary of Contents for Application Server
Page 1: ...Red Hat Application Server JOnAS User Guide ...
Page 8: ......
Page 22: ...14 Chapter 1 Java Open Application Server JOnAS a J2EE Platform ...
Page 58: ...50 Chapter 3 JOnAS Configuration ...
Page 66: ...58 Chapter 5 JOnAS Class Loader Hierarchy ...
Page 78: ...70 Chapter 6 JOnAS Command Reference ...
Page 80: ......
Page 86: ...78 Chapter 7 Developing Session Beans ...
Page 136: ...128 Chapter 9 Developing Message Driven Beans ...
Page 142: ...134 Chapter 10 Defining the Deployment Descriptor ...
Page 148: ...140 Chapter 11 Transactional Behavior of EJB Applications ...
Page 158: ...150 Chapter 14 EJB Packaging ...
Page 162: ...154 Chapter 15 Application Deployment and Installation Guide ...
Page 164: ......
Page 176: ...168 Chapter 18 WAR Packaging ...
Page 178: ......
Page 184: ...176 Chapter 20 Defining the Client Deployment Descriptor ...
Page 186: ...178 Chapter 21 Client Packaging ...
Page 188: ......
Page 192: ...184 Chapter 23 EAR Packaging ...
Page 194: ......
Page 200: ...192 Chapter 24 JOnAS Services ...
Page 204: ...196 Chapter 25 JOnAS and the Connector Architecture ...
Page 222: ...214 Chapter 27 Ant EJB Tasks Using EJB JAR ...
Page 234: ...226 Chapter 29 Web Services with JOnAS ...
Page 236: ......
Page 260: ...252 Chapter 34 How to use Axis in JOnAS ...
Page 270: ...262 Chapter 36 Web Service Interoperability between JOnAS and BEA WebLogic ...
Page 296: ......