Friday, March 25, 2005

:: Add the Servlet.jar into the J2SE directory ::

I knew how to install the Servlet.jar into the J2SE. Thanks 基 here :) !

Setup the Servlet:

First of all, copy the Servlet.jar from Tomcat’s directory to J2SDK1.4.2_07 directory

For example:

Source: C:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar

Destination: C:\j2sdk1.4.2_07\jre\lib\ext

Then we can compile the Java file.

Under the ROOT directory,

We should build the WEB-INF and META-INF directories under the ROOT.

Under the WEB-INF folder, it should contains web.xml which contains the information about all the servlets and URL-pattern, classes and lib.

Under the sub-folder classes, which contain all the Java files and compiled files.

First of all, write a Java Servlet program.

Compile it under the Java2 SE with servlet.jar

Place the compiled file under the sub-folder “classes” under the folder WEB-INF.

Modify the "web.xml" under the folder WEB-INF.

Add the following command in the web.xml

getServlet

Tutorial 8 - Example 1

httpGetServlet

AND

getServlet

/getServlet



In the folder of META-INF, it contains the file called "content.xml"of locates the location of the folder and files.

0 Comments:

Post a Comment

<< Home