Vous êtes sur la page 1sur 42

c  

c  Ê ÊÊÊ Ê
 Ê  Ê Ê ÊÊ Ê
ÊÊ  Ê ÊÊ Ê
 Ê Ê  Ê Ê 
ÊÊ ÊÊÊÊÊÊ  Ê
ÊÊ

Swing widgets provide more sophisticated GUI components than the earlier Abstract Window Toolkit.
Since they are written in pure Java, they run the same on all platforms, unlike the AWT which is tied to
the underlying platform's windowing system. Swing supports pluggable look and feel ʹ not by using the
native platform's facilities, but by roughly emulating them. This means you can get any supported look
and feel on any platform. The disadvantage of lightweight components is possibly slower execution. The
advantage is uniform behavior on all platforms.

ë
Ê
Ê
!Ê Ê ÊÊÊ ÊÊ  Ê   "Ê
 Ê  Ê  "Ê Ê"Ê
#Ê$$  Ê   ÊÊ
Ê ÊÊ%Ê&'Ê&(('Ê
Ê
)Ê* Ê+Ê&(('ÊÊ,  "$ÊÊ#Ê$$  Ê   ÊÊ
 Ê  ÊÊ$ ÊÊ Ê Ê ÊÊ
 $ÊÊ  Ê ÊÊÊ
  ÊÊÊ$Ê  "Ê  Ê"ÊÊ Ê  ÊÊ$ $ÊÊ
ÊÊ ÊÊ
Ê
Ê  "Ê$Ê ÊÊ  ÊÊÊ Ê Ê$ Ê
 ÊÊÊÊ  ÊÊ!Ê   Ê
Ê Ê
 ÊÊÊ ÊÊ

ÊÊ Ê$ÊÊ$ÊÊ Ê


Ê Ê$Ê Ê Ê
  ÊÊ
Ê
Ê
 $Ê Ê! Ê
 ÊÊ$ Ê Ê"ÊÊ ÊÊ
 Ê  -Ê Ê Ê  "Ê

 Ê
$Ê Ê Ê  $Ê

uriginally distributed as a separately downloadable library, Swing has been included as part of the Java
Standard Edition since release 1.2. The Swing classes are contained in the javax.swing package hierarchy.

a  

The Swing library makes heavy use of the Model/View/Controller software design pattern, which
attempts to separate the data being viewed from the method by which it is viewed. Because of this,
most Swing components have associated models (typically as interfaces), and the programmer can use
various default implementations or provide their own. For example, the JTable has a model called
TableModel that describes an interface for how a table would access tabular data. A default
implementation of this operates on a two-dimensional array.

Swing favors relative layouts (which specify the positional relationships between components), as
opposed to absolute layouts (which specify the exact location and size of components). The motivation
for this is to allow Swing applications to work and appear visually correct regardless of the underlying
systems colors, fonts, language, sizes or I/u devices. This can make screen design somewhat difficult and
numerous tools have been developed to allow visual designing of screens.
Swing also uses a publish subscribe event model (as does AWT), where listeners subscribe to events that
are fired by the application (such as pressing a button, entering text or clicking a checkbox). The model
classes typically include, as part of their interface, methods for attaching listeners (this is the publish
aspect of the event model).

The frequent use of loose coupling within the framework makes Swing programming somewhat
different from higher-level GUI design languages and 4GLs. This is a contributing factor to Swing having
such a steep learning curve.

r   

Swing allows one to specialize the look and feel of widgets, by modifying the default (via runtime
parameters), deriving from an existing one, by creating one from scratch, or, beginning with J2SE 5.0, by
using the skinnable Synth Look and Feel, which is configured with an XML property file. The look and feel
can be changed at runtime, and early demonstrations of Swing would frequently provide a way to do
this.

   a

Since early versions of Java, a portion of the Abstract Windowing Toolkit (AWT) has provided platform
independent APIs for user interface components. In AWT, each component is rendered and controlled
by a native peer component specific to the underlying windowing system.

By contrast, Swing components are often described as lightweight because they do not require
allocation of native resources in the operating system's windowing toolkit. The AWT components are
referred to as heavyweight components.

Much of the Swing API is generally a complementary extension of the AWT rather than a direct
replacement. In fact, every Swing lightweight interface ultimately exists within an AWT heavyweight
component because all of the top-level components in Swing (JApplet, JDialog, JFrame, and JWindow)
extend an AWT top-level container. The core rendering functionality used by Swing to draw its
lightweight components is provided by Java2D, another part of JFC. However, the use of both
lightweight and heavyweight components within the same window is generally discouraged due to Z-
order incompatibilities.

   

The Standard Widget Toolkit (SWT) is a competing toolkit originally developed by IBM and now
maintained by the Eclipse Foundation. SWT's implementation has more in common with the
heavyweight components of AWT. This confers benefits such as more accurate fidelity with the
underlying native windowing toolkit, at the cost of an increased exposure to the native resources in the
programming model.

The advent of SWT has given rise to a great deal of division among Java desktop developers with many
strongly favouring either SWT or Swing. A renewed focus on Swing look and feel fidelity with the native
windowing toolkit in the approaching Java SE 6 release (as of February 2006) is probably a direct result
of this.

º 

The following is a Hello World program using Swing.

import javax.swing.JFrame;
import javax.swing.JLabel;

public final class HelloWorld extends JFrame {


private HelloWorld() {
setDefaultCloseuperation(JFrame.DISPuSE_u _CLuSE);
getContentPane().add(new JLabel("Hello, World!"));
pack();
setLocationRelativeTo(null);
}

public static void main(String[] args) {


new HelloWorld().setVisible(true);
}
}

Free Java Source Code | Java Programs

{
c  
 


 Ê

 

Ê

Ê,
+.Ê

ÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ11 Ê ÊÊ$$Ê Ê $Ê

ÊÊÊÊÊÊ11   Ê Ê


 $ÊÊ Ê Ê

ÊÊÊÊÊÊ Ê Ê2Ê   /304Ê


ÊÊÊÊÊÊ Ê5Ê2Ê   /&04Ê

ÊÊÊÊÊÊ
 Ê6Ê5Ê

ÊÊÊÊÊÊÊÊÊÊ"$  78Ê Ê  ÊÊ8754Ê

ÊÊÊÊÊÊÊ

ÊÊÊÊÊÊÊÊÊÊ"$ 578Ê Ê  ÊÊ87 4Ê

ÊÊ9Ê

Ê

 Ê




 
 
!
Ê

Ê, 
+.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ11 Ê ÊÊ$$Ê Ê $Ê

ÊÊÊÊÊÊ11   Ê Ê


 $ÊÊ Ê Ê

ÊÊÊÊÊÊ Ê Ê2Ê   /304Ê

ÊÊÊÊÊÊ Ê5Ê2Ê   /&04Ê

ÊÊÊÊÊÊ Ê Ê2Ê :5; <54Ê

ÊÊÊÊÊÊ"$  78Ê ÊÊ$  $$Ê 84Ê

ÊÊ9Ê

Ê

 "Ê

#$   !
  %    
 !   
 % & '
 !   % 


 !  Ê

() *  
  %  % ' Ê

() +' Ê
(),   *  
  %  % ' Ê

#Ê

Ê= $.Ê

ÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊ Ê2Ê>?>+4Ê11 Ê$ ÊÊ

ÊÊÊÊÊÊ"$ 8$Ê ÊÊ  ÊÊÊ$ Ê<Ê87,  4Ê

ÊÊÊÊÊÊ"$ 8 Ê#$ Ê<Ê87 4Ê

ÊÊÊÊÊÊ"$ 8@ Ê ÊÊ  ÊÊÊ$ Ê<Ê87,


  4Ê

ÊÊ9Ê

Ê

 -Ê

#$   !
 
  ./ 

'  
001  Ê

%
 


 %  !
 Ê

#Ê

ÊA$%$.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ
  Ê 2&4 :2B4 77.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$  , $C&334Ê

ÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊ9Ê

Ê

 .Ê

#$   !
 
!       

Ê

 &
'  '    Ê
#Ê

Ê %$.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ Ê$ Ê2Ê   /304ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ11 Ê$ ÊÊ$$Ê Ê $Ê

ÊÊÊÊÊÊÊÊÊ $ 1&3.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ&3<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ(<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊD<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8E84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊF<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8= "Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ'<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 884Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊB<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8G ÊH 84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ?<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8I 84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ><Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ+<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ&<Ê
ÊÊÊÊÊÊÊÊÊÊÊÊÊ3<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8= "ÊI 84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ
<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8  Ê ÊE 84Ê

ÊÊÊÊÊÊ9Ê

Ê9Ê

Ê

 2Ê

#$   !
 
3+4/543{ 
  4 #Ê

Ê$JI J
%  .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304ÊÊÊÊÊÊÊÊÊ11 Ê ÊÊ$$Ê Ê $Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê$ 234Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ11@ Ê
 Ê$Ê
Ê  Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ $63.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê$4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$ 4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8$Ê
Ê%  Ê
 Ê87$78Ê Ê<Ê87 4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ11@ Ê
 Ê Ê
Ê  Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ$Ê2Ê$4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê&4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ $Ê6Ê3.Ê
ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê ÊCÊ$4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$ 4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8I Ê


Ê%  Ê
 Ê87$78Ê Ê<Ê87 4Ê

ÊÊÊ9Ê

Ê

 6Ê

#$   !
 
 
 
 
#Ê

Ê .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ11 Ê $ÊÊ$$Ê Ê

ÊÊÊÊÊÊÊÊÊÊ Ê Ê2Ê&4Ê

ÊÊÊÊÊÊÊÊÊÊ $63.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê ÊCÊ$4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$ 4Ê

ÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊ"$ 8 Ê


Ê ÊÊ Ê<Ê87 4Ê

ÊÊÊ9Ê

Ê

 7Ê

#$   !
 
/     
#Ê

ÊA  .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê


ÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ11 Ê $ÊÊ$$Ê Ê

ÊÊÊÊÊÊÊÊÊÊ Ê $  Ê 234Ê

ÊÊÊÊÊÊÊÊÊÊ $63.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ $  Ê2Ê$K&34Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê ÊCÊ&3Ê7Ê $  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$Ê2Ê$1&34Ê

ÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊ"$ 8A  Ê$ Ê Ê<Ê87 4Ê

ÊÊÊÊ9Ê

Ê

 8Ê

#$   !
 
'
   
  

 ! 9Ê

*! (7Ê

5 ! (".7"Ê

#Ê

Ê  .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ11 ÊÊÊ$$Ê Ê $Ê

ÊÊÊÊÊÊÊÊÊÊ"$ 8CCCCC  Ê CCCCC84Ê

ÊÊÊÊÊÊÊÊÊÊ Ê
&Ê
+23Ê
>2&4Ê

ÊÊÊÊÊÊÊÊÊÊ
  Ê 2&4 :2$4 77.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8Ê87
>78Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ
&Ê2Ê
+4Ê
ÊÊÊÊÊÊÊÊÊÊÊÊÊ
+Ê2Ê
>4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ
>Ê2Ê
&Ê7Ê
+4Ê

ÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊ9Ê

Ê

 0Ê

#$   !
 

     % 00 Ê

  % 00 %  ' ' 6#Ê

Ê$)
%  .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ Ê 234Ê

ÊÊÊÊÊÊ
  Ê 2&334 :2+334 77.Ê

ÊÊÊÊÊÊÊÊÊÊÊ
 KF223Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ 72 4Ê

ÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊ"$ 8)Ê
ÊI  $Ê Ê<Ê87 4Ê

ÊÊÊ9Ê

{
c  
 


 Ê
Ê
#$   !
 
{
   
,


Ê
 ! 9Ê

*! (.Ê

5 ! ("-.#Ê
Ê  .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊ Ê Ê2Ê8Ê84Ê

ÊÊÊÊÊÊ
  Ê 2&4 :2$4 77.Ê

ÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê Ê7Ê8Ê84Ê

ÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊ"$  4Ê

ÊÊ9Ê


 ÊÊ

#
 
4!  !  
 ' #Ê

Ê,   !.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊ"$ 8CCCCC,@!I@*!)#Ê!*L@ECCCCC84Ê

ÊÊÊÊÊÊ
  Ê 2&4 :2$4 77.Ê

ÊÊÊÊÊÊÊÊÊ
  Ê52&45:2$4577.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8Ê87 C578Ê84Ê

ÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊ"$ 8M84Ê

ÊÊÊÊÊÊ9Ê
ÊÊ9Ê


 "Ê

#$   !
 
 ! %   #Ê

Ê.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ Ê$&Ê2Ê   /304Ê

ÊÊÊÊÊÊ Ê$+Ê2Ê   /&04Ê

ÊÊÊÊÊÊ"$ 8MCCCL
 Ê CCC84Ê

ÊÊÊÊÊÊ"$ 8#$ Ê&Ê<Ê87$&4Ê

ÊÊÊÊÊÊ"$ 8#$ Ê+Ê<Ê87$+4Ê

ÊÊÊÊÊÊ11Ê Ê

ÊÊÊÊÊÊ$&Ê2Ê$&Ê7Ê$+4Ê

ÊÊÊÊÊÊ$+Ê2Ê$&Ê Ê$+4Ê

ÊÊÊÊÊÊ$&Ê2Ê$&Ê Ê$+4Ê

ÊÊÊÊÊÊ"$ 8MCCC*
 Ê CCC84Ê

ÊÊÊÊÊÊ"$ 8#$ Ê&Ê<Ê87$&4Ê

ÊÊÊÊÊÊ"$ 8#$ Ê+Ê<Ê87$+4Ê

ÊÊÊÊÊÊ9Ê


 -Ê
#$   !
 

  

 

 %  Ê

:  %  %
 %
"0 ;Ê

 ! 9Ê

*! (28Ê

5 ! (28 <


 % 8 #Ê

Ê%",%$.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊ Ê"Ê2Ê$K>34Ê

ÊÊÊÊÊÊ Ê$Ê2Ê$1>34Ê

ÊÊÊÊÊÊ"$ $78Ê"Ê2Ê87$78Ê,ÊÊ87"78Ê"84Ê

ÊÊÊ9Ê


 .Ê

1CG ÊÊ  $ÊÊ ÊÊ! Ê

ÊÊ<Ê

ÊÊ&Ê

ÊÊ+Ê+Ê

ÊÊ>Ê>Ê>Ê

ÊÊ?Ê?Ê?Ê?ÊÊÊÊÊ Ê Ê Ê$ ÊC1Ê

Ê! .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê


ÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊÊÊÊÊ
  Ê 2&4 :2$4 77.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ
  Ê52&45:2 4577.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8Ê87 78Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8M84Ê

ÊÊÊÊÊÊÊÊÊÊÊ9ÊÊ

ÊÊÊÊ9Ê


 2Ê

#$   !
 
4! *    Ê

 ! 9Ê

*! (.Ê

5 ! 9Ê

.....Ê

----Ê

"""Ê

Ê

Ê

#Ê

Ê  ! .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê


ÊÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊÊÊÊÊÊ $Ê6Ê3.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ
  Ê52&45:2$4577.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8Ê87$78Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8M84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$ 4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊ9Ê


 6Ê

#$   !
 
% %  
 



 ! 9Ê

*! (."Ê

5 ! (=">.=">"="<."1
  

#Ê

Ê* $ .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊ ÊÊ2Ê$4Ê11ÊÊ ÊÊÊ $Ê

ÊÊÊÊÊÊ Ê 23 $  4Ê

ÊÊÊÊÊÊ $Ê6Ê3.Ê

ÊÊÊÊÊÊÊÊÊÊÊ $  Ê2Ê$ÊKÊ&34Ê


ÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê , $  >4Ê

ÊÊÊÊÊÊÊÊÊÊÊ$Ê2Ê$Ê1Ê&34Ê

ÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊ
 Ê22ÊÊ

ÊÊÊÊÊÊÊÊÊÊÊÊ"$ 78Ê ÊÊ* $ Ê#$ 84Ê

ÊÊÊÊÊÊÊ

ÊÊÊÊÊÊÊÊÊÊÊÊ"$ 78Ê ÊÊÊ* $ Ê#$ 84Ê

ÊÊÊ9Ê


 7Ê

#$   !
 
% % '   
+
#Ê

ÊI $#.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊÊÊÊ Ê
234Ê

ÊÊÊÊÊÊÊÊÊ
  Ê 2+4 :$4 77.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ
$K 223Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ $78Ê ÊÊÊI $Ê#$ 84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ
Ê2Ê&4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê
ÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊ

223Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ $78Ê ÊÊI $Ê#$ 84Ê

ÊÊÊÊ9Ê


 8Ê

#$   !
 
% % 
! 
 


 ! 9Ê

*! (. ! 


 

*! ("-.
 ! 
 
#Ê

ÊI  $.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊÊÊÊÊ ÊÊ2Ê$4Ê11ÊÊÊ $Ê Ê

ÊÊÊÊÊÊÊÊÊÊ Ê   23 $  4Ê

ÊÊÊÊÊÊÊÊÊÊ $Ê6Ê3.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ $  Ê2Ê$ÊKÊ&34Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ   Ê2Ê   ÊCÊ&3Ê7Ê $  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$Ê2Ê$Ê1Ê&34Ê

ÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊ
   Ê22ÊÊ

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 78Ê ÊÊI  $Ê#$ 84Ê


ÊÊÊÊÊÊÊÊÊÊÊ

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 78Ê ÊÊÊI  $Ê#$ 84Ê

ÊÊÊÊÊ9Ê

{
c  
 " 

 0Ê

# %   
Ê

 ! 9Ê

*! (-Ê

5 ! (5  

 #Ê

ÊÊ

Ê %$.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ ".Ê

ÊÊÊÊÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊÊÊÊÊ ÊÊ2Ê$4Ê11ÊÊÊ $Ê Ê

ÊÊÊÊÊÊÊÊÊÊ Ê   23 $  4Ê

ÊÊÊÊÊÊÊÊÊÊ $Ê6Ê3.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ $  Ê2Ê$ÊKÊ&34Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ   Ê2Ê   ÊCÊ&3Ê7Ê $  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$Ê2Ê$Ê1Ê&34Ê

ÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊ Ê 2884Ê11 ÊÊÊÊ


ÊÊÊÊÊÊÊÊÊÊ    Ê6Ê3.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ $  Ê2Ê   ÊKÊ&34Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ   Ê2Ê   Ê1Ê&34Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  $  .Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ3Ê<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8N Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ&Ê<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8)Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ+Ê<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8!Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ>Ê<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8! Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ?Ê<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8 Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊBÊ<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8 Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ'Ê<Ê
ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8 Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊFÊ<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8 Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊDÊ<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8E Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ(Ê<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7Ê8# Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ
<Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ 2884Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$  4Ê

ÊÊÊÊÊÊÊÊ9E Ê.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8  Ê#$ Ê $84Ê

ÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊ9Ê


 Ê
#$   !
 
  ë 
  Ê

 ! 9Ê

*! (.Ê

5 ! (>>">->.<7:!!
 ;#Ê

ÊH $  .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ Ê$Ê2Ê   /304Ê

ÊÊÊÊÊÊÊ Ê2Ê334Ê

ÊÊÊÊÊÊ $Ê6Ê3.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ Ê2Ê Ê7ÊÊ&Ê1Ê$4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊ$ 4Ê

ÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊ"$ 8)Ê
ÊH $ Ê Ê Ê87 4Ê

ÊÊ9Ê


 Ê

#$   !
 
   

   +5
  
#Ê

ÊE )J* .Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊ ÊÊ2Ê   /304Ê

ÊÊÊÊÊÊ ÊE 23)23$E 23$)234Ê

ÊÊÊÊÊÊ Ê6Ê3.Ê
ÊÊÊÊÊÊÊÊÊÊÊ
K+223.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊE 774Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$E Ê2Ê$E Ê7Ê4Ê

ÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊ.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ)774Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ$)Ê2Ê$)Ê7Ê4Ê

ÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊ 4Ê

ÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊ Ê * * 4Ê

ÊÊÊÊÊÊ * Ê2Ê$E 1E 4Ê

ÊÊÊÊÊÊ* Ê2Ê$)1)4Ê

ÊÊÊÊÊÊ"$ 8*  Ê


Ê
Ê#ÊE ÊÊ Ê87 * 4Ê

ÊÊÊÊÊÊ"$ 8*  Ê


Ê
Ê#Ê)ÊÊ Ê87* 4Ê

ÊÊ

ÊÊ9Ê


 "Ê

#4!     

9?/@45Ê

Ê

"Ê
-.2Ê

6780+#Ê

Ê)&.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ Ê234Ê

ÊÊÊÊÊÊÊÊÊÊ ÊÊ2Ê   /304Ê

ÊÊÊÊÊÊÊÊÊ&<Ê
  Ê 2&4 :24 77.Ê

ÊÊÊÊÊÊÊÊÊ+<Ê
  Ê52&45:2 4577.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ
O2.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ774Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 78Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ  Ê&4Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8M84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊ9Ê


 -Ê

#4!     

0Ê
0Ê

0Ê

00#Ê

Ê)+.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊÊ
  Ê 2&4 :2?4 77.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊ
  Ê52&45:2 4577.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$  75K+78Ê84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$ 8M84Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ9Ê

ÊÊÊÊÊ9Ê

9ÊÊ


 .Ê

#4!     

Ê

-Ê

"28Ê

-72+: 

/
;#Ê

Ê)>.Ê

ÊÊÊÊÊÊ Ê Ê  Ê$  Ê /0.Ê

ÊÊÊÊÊÊÊÊÊÊ ÊÊ2Ê   /304Ê


ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ
  Ê 2&4 :24 77.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ
  Ê52&45:2 4577.Ê

ÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊÊ"$  C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y=Y/
Y .Y/

YYY/!/
+'
HY

Y #Y/Y/
Y Y/(
Y
YY$
Y/
&  
Y/1
Y/%

Y 1
Y%#Y/
Y Y/11KKY/
Y Y/ 
/!#$118$

-8 8-
;
Y%#Y/
Y Y/ Y#- -$$
%

Y 1Y/
Y Y/ Y/#Y/
Y Y/
 Y
)%#- -$64$
Y
/!1 ! ##%

Y  
/!#$2
YY$$
Y%#%

Y  
/!#$R
YY$

&  
Y/1Y/
Y Y/
%#YY18YR
/!Y66$

&  
Y/1
&  
Y/6-8-
;
;

Y%#%

Y  
/!#$P
YY$

&  
Y/1Y/
Y Y/ Y/#8(
Y/
Y Y/ 
/!#$2
/!$
Y%#
YY118$

&  
Y/1
&  
Y/ Y/#8(

&  
Y/ Y
)%#- -$$
 ;


 
&  
Y/1Y/
Y Y/
 ;

 ;


  Y%#
YYP8$
  
&  
Y/1Y/
Y Y/6- -
  


  
&  
Y/1Y/
Y Y/
  %#YY18YR
YYY66$
  
&  
Y/1
&  
Y/6-8-
  ;
 ;
;


&  
Y/
;

YYY Y#Y//BC$
 YYS148
 

S148 G8:888
 %%S1@:@G@:G@:@:D GADTAG: 
 Y/ Y/1-@:@(G@:(G@G(888 8-
 =Y/
Y * 
1
&=Y/
Y #-49@: DTAG-$
 
 
 
 Y#* 
YY !/
+
Y   #
&
.
/
#YS$$$
 
 Y#* 
YY !/
+
Y   #
&

#
S$$$
 
 Y#* 
YY !/
+
Y   #
&
#%S$$$
 
 
 Y#* 
YY 

   * 
# Y/$$
 

 
 Y#* 
YY !/
+'
HY

Y #* 
 
Y/#$(D$$
 
;
;
c  a 

A Java applet is an applet delivered in the form of Java bytecode. Java applets can run in a Web browser
using a Java Virtual Machine (JVM), or in Sun's AppletViewer, a stand alone tool to test applets. Java
applets were introduced in the first version of the Java language in 1995. Java applets are usually written
in the Java programming language but they can also be written in other languages that compile to Java
bytecode such as Jython.

Applets are used to provide interactive features to web applications that cannot be provided by HTML.
Since Java's bytecode is platform independent, Java applets can be executed by browsers for many
platforms, including Windows, Unix, Mac uS and Linux. There are open source tools like applet2app
which can be used to convert an applet to a stand alone Java application/windows executable. This has
the advantage of running a Java applet in offline mode without the need for internet browser software.

A Java Servlet is sometimes informally compared to be "like" a server-side applet, but it is different in its
language, functions, and in each of the characteristics described here about applets.

     

Java applets are executed in a sandbox by most web browsers, preventing them from accessing local
data. The code of the applet is downloaded from a web server and the browser either embeds the
applet into a web page or opens a new window showing the applet's user interface. The applet can be
displayed on the web page by making use of the deprecated applet HTML element or the recommended
object element. This specifies the applet's source and the applet's location statistics.

A Java applet extends the class java.applet.Applet, or in the case of a Swing applet, javax.swing.JApplet.
The class must override methods from the applet class to set up a user interface inside itself (Applet is a
descendant of Panel which is a descendant of Container).

a       

A Java applet can have any or all of the following advantages:

* it is simple to make it work on Windows, Mac uS and Linux, i.e. to make it cross platform
* the same applet can work on "all" installed versions of Java at the same time, rather than just the
latest plug-in version only. However, if an applet requires a later version of the JRE the client will be
forced wait during the large download.
* it runs in a sandbox, so the user does not need to trust the code, so it can work without security
approval
* it is supported by most web browsers
* it will cache in most web browsers, so will be quick to load when returning to a web page
* it can have full access to the machine it is running on if the user agrees
* it can improve with use: after a first applet is run, the JVM is already running and starts quickly,
benefiting regular users of Java
* it can run at a comparable (but generally slower) speed to other compiled languages such as C++
* it can be a real time application
* it can move the work from the server to the client, making a web solution more scalable with the
number of users/clients

       

A Java applet is open to any of the following disadvantages:

* it requires the Java plug-in, which isn't available by default on all web browsers
* it can't start up until the Java Virtual Machine is running, and this may have significant startup time the
first time it is used
* if it is uncached, it must be downloaded (usually over the internet), and this takes time
* it is considered more difficult to build and design a good user interface with applets than with HTML-
based technologies
* if untrusted, it has severely limited access to the user's system - in particular having no direct access to
the client's disc or clipboard
* some organizations only allow software installed by the administrators. As a result, many users cannot
view applets by default.
* applets may require a specific JRE.

   


Sun has made a considerable effort to ensure compatibility is maintained between Java versions as they
evolve. For example, Microsoft's Internet Explorer, the most popular web browser since the late 1990s,
used to ship with Microsoft's own JVM as the default. The MSJVM had some extra non-Java features
added which, if used, would prevent MSJVM applets from running on Sun's Java (but not the other way
round). Sun sued for breach of trademark, as the point of Java was that there should be no proprietary
extensions and that code should work everywhere. Development of MSJVM was frozen by a legal
settlement, leaving many users with an extremely outdated Java virtual machine. Later, in uctober 2001,
MS stopped including Java with Windows, and for some years it has been left to the computer
manufacturers to ship Java independently of the uS. Most new machines now ship with official Sun Java.

Some browsers (notably Firefox) do not do a good job of handling height=100% on applets which makes
it difficult to make an applet fill most of the browser window (Javascript can, with difficulty, be used for
this). Having the applet create its own main window is not a good solution either, as this leads to a large
chance of the applet getting terminated unintentionally and leaves the browser window as a largely
useless extra window.

a    

Alternative technologies exist (for example, DHTML and Flash) that satisfy some of the scope of what is
possible with an applet.

Another alternative to applets for client side Java is Java Web Start, which runs outside the browser. In
addition to the features available to applets, a simple permissions box can give Java Web Start programs
read and/or write access to specified files stored on the client, and to the client's clipboard.

Java Servlet
c     API allows a software developer to add dynamic content to a Web server using the Java
platform. The generated content is commonly HTML, but may be other data such as XML. Servlets are
the Java counterpart to dynamic web content technologies such as CGI, PHP or ASP. Servlets can
maintain state across many server transactions by using HTTP cookies, session variables or URL
rewriting.

The Servlet API, contained in the Java package hierarchy javax.servlet, defines the expected interactions
of a web container and a servlet. A web container is essentially the component of a web server that
interacts with the servlets. The web container is responsible for managing the lifecycle of servlets,
mapping a URL to a particular servlet and ensuring that the URL requester has the correct access rights.

*Ê Ê ÊÊ5ÊÊ  Ê PÊ APÊÊ ÊÊ Ê


 AÊÊÊÊ PÊ!Ê*IÊ Ê5  Ê
ÊH!!IÊ
Ê
ÊÊ Ê ÊH Ê PÊH APÊÊ Ê
H AÊÊÊÊÊH ÊÊ  Ê$ Ê PÊÊ Ê
ÊÊÊ  ÊÊÊ Ê Ê$"ÊÊ Ê ÊÊG*AÊ
ÊÊÊGÊ
  Ê
Ê
,   Ê ÊÊÊ Ê$ "Ê"Ê    ÊIÊ IÊ Ê "Ê"Ê
$Ê ÊÊÊG, Ê)
Ê Ê ÊÊ Ê5 Ê Ê IÊ ÊÊ
 ÊÊ8,Ê+8Ê Ê ÊÊ
  Ê
ÊÊ$    Ê Ê

ë
Ê
Ê
!Ê  Ê Ê
 ÊÊ Ê"ÊÊ,  "$Ê   Ê&3ÊÊ
 QÊ Ê
Ê&((FÊ  Ê Ê   Ê+>ÊÊ Ê
 ÊÊ Ê ÊÊ  Ê
$$ "ÊI Ê AÊB>Ê
ÊÊÊ Ê+>ÊÊ    ÊIÊ&+Ê
 Ê
AÊ&B?Ê
ÊÊ Ê+?ÊÊ+BÊ
 Ê*Ê
Ê,"Ê&3Ê+33'ÊÊ Ê   Ê

ÊÊ Ê
 Ê Ê+BÊ
Ê
Ê ÊÊÊ5 ÊÊ  ÊÊ ÊÊ $Ê% Ê ÊÊ  "Ê
Ê Ê
"Ê $Ê Ê
ÊÊ
Ê Ê ÊÊ "Ê"Ê
Ê  ÊÊÊÊ Ê
Ê$ÊÊ Ê ÊÊ ÊÊ  ÊGÊ  Ê Ê! ÊÊ
 ÊÊ Ê
ÊÊ  ÊI
 $ÊE  ÊE  ÊÊ$Ê ÊÊ
 Ê
Ê
$ '
  Ê
Ê
*ÊGÊ  Ê ÊÊ$ Ê  $ÊÊ ÊGÊ  ÊGÊ  Ê ÊÊ
$ $ÊÊGÊ Ê@ ÊÊ Ê  Ê*IÊ

 Ê  Ê  Ê ÊÊ


$$ ÊLÊ ÊÊ Ê
Ê$Ê
ÊÊ
ÊÊ  Ê#ÊÊ-
-Ê$ÊÊ
$$  ÊÊ Ê
Ê$Ê
ÊÊ$$  Ê  ÊÊA ÊÊ) Ê$ Ê Ê
 $Ê  ÊÊ ÊÊ
ÊÊÊ ÊÊ  Ê $Ê
 Ê  

  Q Ê
Ê
+
(
   '
  Ê

* Java System Application Server is developed by Sun.


* Apache Tomcat (formerly Jakarta Tomcat) is an open source web container available free of charge
under the Apache Software License. It is used in the official reference implementation and has a
reputation for being stable.
* Jetty
* Jaminid contains a higher abstraction than servlets.
* Enhydra
* jo!
* Winstone supports specification v2.4, has a focus on minimal configuration and the ability to strip the
container down to only what you need.
* tjws spec 2.4, small footprint, modular design
      c

c       (JSP) is a Java technology that allows software developers to dynamically generate


HTML, XML or other types of documents in response to a Web client request. The technology allows
Java code and certain pre-defined actions to be embedded into static content.

The JSP syntax adds additional XML-like tags, called JSP actions, to be used to invoke built-in
functionality. Additionally, the technology allows for the creation of JSP tag libraries that act as
extensions to the standard HTML or XML tags. Tag libraries provide a platform independent way of
extending the capabilities of a Web server. JSPs are compiled into Java Servlets by a JSP compiler. A JSP
compiler may generate a servlet in Java code that is then compiled by the Java compiler, or it may
generate byte code for the servlet directly.

"JavaServer Pages" is a technology released by Sun.

c    
Architecturally speaking, JSP can be viewed as a high-level abstraction of servlets that is implemented as
an extension of the Servlet 2.1 API. Both servlets and JSPs were originally developed at Sun
Microsystems, initially created by Anselm Baird-Smith and later elaborated on as a specification by
Satish Dharmaraj. Starting with version 1.2 of the JSP specification, JavaServer Pages have been
developed under the Java Community Process. JSR 53 defines both the JSP 1.2 and Servlet 2.3
specifications and JSR 152 defines the JSP 2.0 specification. As of May 2006 the JSP 2.1 specification has
been released under JSR 245 as part of Java EE 5.

c

A JavaServer Page may be broken down into the following pieces:

* static data such as HTML,


* JSP directives such as the include directive,
* JSP scripting elements and variables,
* JSP actions,
* custom tags

  

Static data is written out to the HTTP response exactly as it appears in the input file. Thus a normal
HTML page with no embedded java or actions would be valid JSP input. In that case, the same data
would be sent in the response each and every time by the web server to the browser.

c   

JSP directives control how the JSP compiler generates the servlet. The following directives are available:

* include ʹ The include directive informs the JSP compiler to include a complete file into the current file.
It is as if the contents of the included file were pasted directly into the original file. This functionality is
similar to the one provided by the C preprocessor. Included files generally have the extension "jspf" (for
JSP Fragment):

<%@ include file="somefile.jspf" %>

* page ʹ There are several options to the page directive.

import results in a Java import statement being inserted into the resulting file
contentType specifies the content that is generated. This should be used if HTML is not used or if the
character set is not the default character set.
errorPage indicates the page that will be shown if an exception occurs while processing the HTTP
request.
isErrorPage if set to true, it indicates that this is the error page.
isThreadSafe indicates if the resulting servlet is thread safe.

<%@ page import="java.util.*" %> //example import


<%@ page contentType="text/html" %> //example contentType
<%@ page isErrorPage=false %> //example for non error page
<%@ page isThreadSafe=true %> //example for a thread safe JSP

ote: unly the "import" page directive can be used multiple times in the same JSP.

* taglib ʹ The taglib directive indicates that a JSP tag library is to be used. The directive requires that a
prefix be specified (much like a namespace in C++) and the URI for the tag library description.

<%@ taglib prefix="myprefix" uri="taglib/mytag.tld" %>

c       

c  

The following JSP implicit objects are exposed by the JSP container and can be referenced by the
programmer:

* out ʹ The JSPWriter used to write the data to the response stream.
* page ʹ The servlet itself.
* pageContext ʹ A PageContext instance that contains data associated with the whole page. A given
HTML page may be passed among multiple JSPs.
* request ʹ The HTTP request object.
* response ʹ The HTTP response object.
* session ʹ The HTTP session object that can be used to track information about a user from one request
to another.
* config ʹ Provides servlet configuration data.
* application ʹ Data shared by all JSPs and servlets in the application.
* exception ʹ Exceptions not caught by application code.

   

There are three basic kinds of scripting elements that allow java code to be inserted directly into the
servlet.

* A declaration tag places a variable definition inside the body of the java servlet class. Static data
members may be defined as well.
<%! int serverInstanceVariable = 1; %>

* A scriptlet tag places the contained statements inside the _jspService() method of the java servlet
class.

<% int localStackBasedVariable = 1;


out.println(localStackBasedVariable); %>

* An expression tag places an expression to be evaluated inside the java servlet class. Expressions should
not be terminated with a semi-colon .

<%= "expanded inline data " + 1 %>

c  

JSP actions are XML tags that invoke built-in web server functionality. The following actions are
provided:

jsp:include Similar to a subroutine, the Java servlet temporarily hands the request and response off to
the specified JavaServer Page. Control will then return to the current JSP, once the other JSP has
finished. Using this, JSP code will be shared between multiple other JSPs, rather than duplicated.
jsp:param Can be used inside a jsp:include, jsp:forward or jsp:params block. Specifies a parameter that
will be added to the request's current parameters.
jsp:forward Used to hand off the request and response to another JSP or servlet. Control will never
return to the current JSP.
jsp:plugin ulder versions of etscape avigator and Internet Explorer used different tags to embed an
applet. This action generates the browser specific tag needed to include an applet.
jsp:fallback The content to show if the browser does not support applets.
jsp:getProperty Gets a property from the specified JavaBean.
jsp:setProperty Sets a property in the specified JavaBean.
jsp:useBean Creates or re-uses a JavaBean available to the JSP page.

º    

jsp:include

<html>
<head></head>
<body>
<jsp:include page="mycommon.jsp" >
<jsp:param name="extraparam" value="myvalue" />
</jsp:include>
name:<%=request.getParameter("extraparam")%>
</body></html>

jsp:forward

<jsp:forward page="subpage.jsp" >


<jsp:param name="forwardedFrom" value="this.jsp" />
</jsp:forward>

In this forwarding example, the request is forwarded to "subpage.jsp". The request handling does not
return to this page.

jsp:plugin

<jsp:plugin type=applet height="100%" width="100%"


archive="myjarfile.jar,myotherjar.jar"
codebase="/applets"
code="com.foo.MyApplet" >
<jsp:params>
<jsp:param name="enableDebug" value="true" />
</jsp:params>
<jsp:fallback>
Your browser does not support applets.
</jsp:fallback>
</jsp:plugin>

The plugin example illustrates a <html> uniform way of embedding applets in a web page. Before the
advent of the <uBJECT> tag, there was no common way of embedding applets. This tag is poorly
designed and hopefully future specs will allow for dynamic attributes (height="${param.height}",
code="${chart}", etc) and dynamic parameters. Currently, the jsp:plugin tag does not allow for
dynamically called applets. For example, if you have a charting applet that requires the data points to be
passed in as parameters, you can't use jsp:params unless the number of data points are constant. You
can't, for example, loop through a ResultSet to create the jsp:param tags. You have to hand code each
jsp:param tag. Each of those jsp:param tags however can have a dynamic name and a dynamic value.

jsp:useBean

<jsp:useBean id="myBean" class="com.foo.MyBean" scope="request" />


<jsp:getProperty name="myBean" property="lastChanged" />
<jsp:setProperty name="myBean" property="lastChanged" value="<%= new Date()%>" />

The scope attribute can be request, page, session or application. It has the following meanings:
* request Ͷ the attribute is available for the lifetime of the request. unce the request has been
processed by all of the JSPs, the attribute will be de-referenced.
* page Ͷ the attribute is available for the current page only.
* session Ͷ the attribute is available for the lifetime of the user's session.
* application Ͷ the attribute is available to every instance and is never de-referenced. Same as a global
variable.

The example above will use a Bean Manager to create an instance of the class com.foo.MyBean and
store the instance in the attribute named "myBean". The attribute will be available for the life-time of
the request. It can be shared among all of the JSPs that were included or forwarded-to from the main
JSP that first received the request.

c    

In addition to the pre-defined JSP actions, developers may add their own custom actions using the JSP
Tag Extension API. Developers write a Java class that implements one of the Tag interfaces and provide a
tag library XML description file that specifies the tags and the java classes that implement the tags.

Consider the following JSP.

<%@ taglib uri="mytaglib.tld" prefix="myprefix" %>


...
<myprefix:myaction> <%-- the start tag %>
...
</myprefix:myaction> <%-- the end tag %>
...

The JSP compiler will load the mytaglib.tld XML file and see that the tag 'myaction' is implemented by
the java class 'MyActionTag'. The first time the tag is used in the file, it will create an instance of
'MyActionTag'. Then (and each additional time that the tag is used), it will invoke the method
doStartTag() when it encounters the starting tag. It looks at the result of the start tag, and determines
how to process the body of the tag. The body is the text between the start tag and the end tag. The
doStartTag() method may return one of the following:

* SKIP_BuDY - the body between the tag is not processed


* EVAL_BuDY_I CLUDE - evaluate the body of the tag
* EVAL_BuDY_TAG - evaluate the body of the tag and push the result onto stream (stored in the body
content property of the tag).

ote: If tag extends the BodyTagSupport class, the method doAfterBody() will be called when the body
has been processed just prior to calling the doEndTag(). This method is used to implement looping
constructs.

When it encounters the end tag, it invokes the doEndTag() method. The method may return one of two
values:

* EVAL_PAGE - this indicates that the rest of the JSP file should be processed.
* SKIP_PAGE - this indicates that no further processing should be done. Control leaves the JSP page. This
is what is used for the forwarding action.

The myaction tag above would have an implementation class that looked like something below:

public class MyActionTag extends TagSupport {


//Releases all instance variables.
public void release() {...}

public MyActionTag() { ... }

//called for the start tag


public int doStartTag() { ... }

//called at the end tag


public int doEndTag(){ ... }
}

Add Body Tag description.

      

Internationalization in JSP is accomplished the same way as in a normal Java application, that is by using
resource bundles.

c

The new version of the JSP specification includes new features meant to improve programmer
productivity. amely:

* An Expression Language (EL) which allows developers to create Velocity-style templates (among other
things).
* A faster/easier way to create new tags.

Hello, ${param.visitor} <%-- same as: Hello, <%=request.getParameter("visitor")%> --%>


£     

Sun recommends that the Model-view-controller pattern be used with the JSP files in order to split the
presentation from request processing and data storage. Either regular servlets or separate JSP files are
used to process the request. After the request processing has finished, control is passed to a JSP used
only for creating the output. There are several platforms based on Model-view-controller pattern for
web tiers (such as Apache Struts and Spring framework).

º 

Regardless of whether the JSP compiler generates Java source code for a servlet or emits the byte code
directly, it is helpful to understand how the JSP compiler transforms the page into a Java servlet. For an
example, consider the following input JSP and its resulting generated Java Servlet.

Input JSP

<%@ page errorPage="myerror.jsp" %>


<%@ page import="com.foo.bar" %>

<html>
<head>
<%! int serverInstanceVariable = 1;%>
...
<% int localStackBasedVariable = 1; %>
<table>
<tr><td><%= "expanded inline data " + 1 %></td></tr>
...

Resulting servlet

package jsp_servlet;
import java.util.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;

import com.foo.bar; //imported as a result of <%@ page import="com.foo.bar" %>


import ...

class _myservlet implements javax.servlet.Servlet, javax.servlet.jsp.HttpJspPage {


//inserted as a
//result of <%! int serverInstanceVariable = 1;%>
int serverInstanceVariable = 1;
...

public void _jspService( javax.servlet.http.HttpServletRequest request,


javax.servlet.http.HttpServletResponse response )
throws javax.servlet.ServletException,
java.io.IuException
{
javax.servlet.ServletConfig config = ...;//get the servlet config
ubject page = this;
PageContext pageContext = ...;//get the page context for this request
javax.servlet.jsp.JspWriter out = pageContext.getuut();
HttpSession session = request.getSession( true );
try {
out.print( "<html>\r\n" );
out.print( "<head>\r\n" );
...
//from <% int localStackBasedVariable = 1; %>
int localStackBasedVariable = 1;
...
out.print( "<table>\r\n" );
out.print( " <tr><td>" );
//note, toStringurBlank() converts the expression into a string or if
// the expression is null, it uses the empty string.
//from <%= "expanded inline data " + 1 %>
out.print( toStringurBlank( "expanded inline data " + 1 ) );
out.print( " </td></tr>\r\n" );
...
} catch ( Exception _exception ) {
//clean up and redirect to error page in <%@ page errorPage="myerror.jsp" %>
}
}
}

Vous aimerez peut-être aussi