Developing Web Components; Introduction To Web Component Development; The Jsp - Red Hat APPLICATION SERVER - JONAS Manual

Jonas
Hide thumbs Also See for APPLICATION SERVER - JONAS:
Table of Contents

Advertisement

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
can be integrated in a J2EE application by packing the
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
etc/resources/web
src/org/objectweb/earsample/servlets
src/org/objectweb/earsample/beans
If beans from another application will be used, the
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
table
!-- The header of the table --
tr bgcolor="black"

Developing Web Components

file and can be deployed in a JOnAS server via the
file in an
.war
Contains the
the web application.
Contains HTML pages and images; JSP
pages can also be placed here.
Servlet sources
Beans sources
directory is not needed.
bean
%
br
Chapter 16.
service. Web components
web
file (refer to Chapter 22
.ear
file that describes
web.xml

Advertisement

Table of Contents
loading

This manual is also suitable for:

Application server

Table of Contents