DOC PREVIEW
CMU ISM 95702 - Java Web Services Installation and Servlets

This preview shows page 1-2-3-26-27-28 out of 28 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

95-702 Organizational Communication and Distributed ObjectTechnologies Homework 1 Due Monday September 15Java Web Services Installation and ServletsJava TM Web Services Developer Pack 1.295-733 Internet Technologies Carnegie Mellon University 95-702 Organizational Communication and Distributed Object Technologies Homework 1 Due Monday September 15Java Web Services Installation and ServletsIn this lab we will be using an HTTP server called Tomcat. Tomcat is contained in Sun’s Java Web Services Developer Pack (JWSDP). In Part I, we will present the details associated with the installation andbasic configuration of Tomcat running under Windows NT or Windows 2000 (you may also use Linux). In Part II we will experiment with authentication and servlets. In Part III you will be asked to complete work for submission. Part I Installing Tomcat on Windows NT/Windows 20001) First, you must install the latest edition of Java on your machine. Obtain a copy of the Java 2 SDKStandard Edition (Java 2 SDK) compiler. This compiler is available from Sun Microsystem’s web site at http://java.sun.com/j2se/1.4.2/download.html. Select J2SE v 1.4.2 with NetBeans IDE v 3.5 Cobundle. You should also download and install the Java documentation. This is available from the same page under J2SE v 1.4.2 Documentation. Note that the page contains instructions on installation of the SDK and the documentation. Some of these files arrive in a compressed format. You can use winzip to expand them. You can download an evaluation copy of winzip from http://www.winzip.com/winzip/download.html. Be sure to set your path variable (so that the Java compiler and Java interpreter can be run from any directory using simple commands). Also be sure to set your classpath variable (so that javac and java can find the locations of the classes that your programs will use).The following web site contains directions on how to set the path and classpath variables: http://java.sun.com/j2se/1.3/install-windows.html.2) Next, we will download and install the Java Web Services Developer Pack. This is the “web services developer pack jwsdp v 1.2”. This should be downloaded from Sun’s web page at http://java.sun.com/webservices/downloads/webservicespack.html. I expanded the downloaded file to a directory called D:\jwsdp-1.2 . Please note that you are asked for a username and password during installation. Please remember these for later use (see figure 1.4 below). Also, when prompted, be sure to copy the JAXP classes from the JWSDP installation directory to your <java_home>\jre\lib\endorsed directory. 3) At this point you will need to set four environment variables. On an NT machine, this is done by clicking“Start/Settings/Control Panel/System/Environment” and adding values to the User Variables. On Windows 2000, this is done by clicking Start/Settings/Control Panel/System/Advanced/Environment Variables and adding values to the User Variables. You will need the following:JAVA_HOME D:\j2sdk_nb\j2sdk1.4.2 this is where I installed my SDK JWSDP_HOME D:\jwsdp-1.2 this is where I installed my developer pack Here are my JWSDP related settings for in my user path variable D:\jwsdp-1.2\apache-ant\bin;D:\jwsdp-1.2\bin;D:\jwsdp-1.2\jwsdp-shared\bin;D:\j2sdk_nb\j2sdk1.4.2\bin;C:\batch;. Your classpath variable should be set with D:\jwsdp-1.2\common\lib\servlet.jar;. (note the dot).195-733 Internet Technologies Carnegie Mellon University TESTING THE INSTALLATIONUsing the MyComputer icon, look over the files in the new directory. You should see a directory structure containing many files and subdirectories. For example, your path to the webapps directory should look like the following:D:\jwsdp-1.2\webapps4) Since you have set the path variable to D:\ jwsdp-1.2\bin you should be able to start the Tomcat web server by executing “startup” at the DOS prompt. Type startup. A small box labeled JWSDP 1.2 should appear on your screen.5) Enter the following URL in a browser http://localhost:8080/index.html. Your browser screen should display some information on web services:Java TM Web Services Developer Pack 1.2The source of this html can be found in the file:D:\jwsdp-1.2\webapps\ROOT\index.html.295-733 Internet Technologies Carnegie Mellon University 6) The index.html file and its parent directory are contained in a directory structure similar to the one shown below (the ‘classes’ and ‘lib’ directories are not found under ‘webapps/ROOT’ but are typical of the web applications we will write): D:\jwsdp-1.2 | conf | --- server.xml this is a serverwide configuration file | |webapps the directory holding web applications | ROOT a web application whose contents are publicly | accessible | --- index.html home page for this web application (JSP pages go here too) | WEB-INF contents not served directly to clients but | contains classes and configuration information ---web.xml deployment descriptor containing configuration information for this web application | classes this directory contains servlet classes (built by ant in this homework) | --- someservlet.class | lib this directory holds classes held in jar files | --- my.jar 7) To shut down the server, enter the command shutdown at the DOS prompt. If this does not work but instead executes a Windows shutdown command then you need to make sure that your path variable is set to point to the JWSDP bin directory. 395-733 Internet Technologies Carnegie Mellon University Part II Building a Web Application1) In what follows, we will work under a directory structure away from the web services developer pack. Let’s begin by creating a new directory called “ANewApp”. Under AnewApp,create the following directories: docs, src, and web. Under “AnewApp/web” create a new file called “index.html” as shown in Figure 1.1. Under the directory “AnewApp/web”, create another directory called “WEB-INF”. Note that WEB-INF must be in caps even though it will not appear to be entirely in upper case in some displays. Within the “AnewApp/src” directory, create a servlet called HandleForm.java as shown in Figure 1.2. Under the “web/WEB-INF” directory, create a deployment


View Full Document

CMU ISM 95702 - Java Web Services Installation and Servlets

Documents in this Course
Homework

Homework

12 pages

Lecture

Lecture

25 pages

Lecture

Lecture

21 pages

Lecture

Lecture

24 pages

Exam

Exam

11 pages

Homework

Homework

16 pages

Homework

Homework

38 pages

lecture

lecture

38 pages

review

review

7 pages

lecture

lecture

18 pages

review

review

8 pages

Chapter2

Chapter2

32 pages

Lecture 4

Lecture 4

47 pages

Lecture

Lecture

22 pages

Naming

Naming

26 pages

lecture

lecture

34 pages

lecture

lecture

42 pages

lecture

lecture

112 pages

Lecture

Lecture

33 pages

Axis

Axis

43 pages

lecture

lecture

32 pages

review

review

17 pages

Lecture

Lecture

53 pages

Lecture

Lecture

80 pages

Lab

Lab

14 pages

Load more
Download Java Web Services Installation and Servlets
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Java Web Services Installation and Servlets and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Java Web Services Installation and Servlets 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?