Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
13Activity
0 of .
Results for:
No results containing your search query
P. 1
JSP Tutorial

JSP Tutorial

Ratings:

4.0

(1)
|Views: 2,058|Likes:
Published by api-3834494

More info:

Published by: api-3834494 on Oct 18, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

1
JavaServer Pages(TM) Tutorial
Welcome to the JavaServer PagesTM (JSPTM) technology, the cross-platform method of
generating dynamic content for the Web.
If you have reached this learn-by-example tutorial, you are probably new to the

technology. You might be a Web developer or enterprise developer who wants to use JavaServer Pages to develop dynamic Web applications. The sections in this tutorial contain a series of topics and example applications that teach you how to use the essential features of JavaServer Pages technology:

s\u201cA First JSP Application\u201d on page 4
s\u201cHandling HTML Forms\u201d on page 7
s\u201cUsing Scripting Elements\u201d on page 18
s\u201cHandling Exceptions\u201d on page 26

2
JavaServer Pages Tutorial
Installing and Running the Example
Applications
The example applications described in this tutorial are packaged so that they can be
easily installed and run on the Tomcat JSP and server implementation. To run the
examples:
1. Download and install Tomcat
2. Download the example applications
The complete binary and source code for three of the examples are packaged in
the Web application archiveshelloworld.war,hellouser.war, and
email.war, contained in the zip archiveexamples.zip. To install the
applications in Tomcat, downloadexamples.zip into the directory
TOMCAT_HOME/webappsand unzip the archive. The fourth example,number
guess, is already installed in Tomcat in the directoryTOMCAT_HOME/webapps/
examples/jsp/num.
3. Configure Tomcat for the example applications

When an archived Web application is accessed, Tomcat 3.2 automatically unpacks it into the directoryTOMCAT_HOME/webapps/appNameand adds the context for each archive to the server startup file. If you are using an earlier version of

Tomcat you will need to:
s
Unpack the Web application archive with the commandjar xvf
appName.war.
sAdd the following line to the fileTOMCAT_HOME/conf/server.xml for each
application:
<Context path="/appName" docBase="webapps/appName" debug="0"
reloadable="true" />

When a Web application archive is unpacked, its contents are deposited into the directories listed in the following table. This directory layout is required by the Java Servlet specification and is one that you usually will use while developing an application.

Directory
Contents
appName
JSP, HTML, and image files
appName/WEB-INF/classesclasses accessed by JSP files
Installing and Running the Example Applications
3
4. Open the URL of the first page of each example in a Web browser:
s
http://localhost:8080/helloworld/helloworld.jsp

shttp://localhost:8080/hellouser/hellouser.jsp
shttp://localhost:8080/examples/jsp/num/numguess.jsp
shttp://localhost:8080/email/email.jsp

Activity (13)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
Ann Juvie Papas liked this
porur liked this
darwin liked this
ssoni83 liked this
Bruno12 liked this
verma0130 liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->