File: INSTALL

package info (click to toggle)
jserv 1.1-3
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 4,616 kB
  • ctags: 3,003
  • sloc: sh: 7,718; java: 6,652; ansic: 4,755; makefile: 816; perl: 39; xml: 32
file content (63 lines) | stat: -rw-r--r-- 3,786 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Installing the classes
======================

First check whether you already have the servlet classes in your CLASSPATH, and if so remove them.
	The easiest way to check for this is to type "javap javax.servlet.Servlet"
	If it says "Class 'javax.servlet.Servlet' not found" you're fine.
	Otherwise you have to remove the current servlet library from
	you CLASSPATH and start in a new shell.

Add the servlet classes to your CLASSPATH
	The archive contains 6 jar files. servlet-2.0.jar, servlet_intl-2.0.jar, servlet-2.1.jar, servlet_intl-2.1.jar, servlet-2.2.jar and servlet_intl-2.2.jar.
	Include servlet-2.0.jar in your CLASSPATH if you want servlets according to the 2.0 specs, and servlet-2.1.jar if you want 2.1 servlets.
	Apache JServ uses the 2.0 servlets.
	Most other servlet engines use the 2.1 variant.

To "-intl" or not to "-intl":
	The "-intl" jar files contain the "international" version of
	urlDecode.
	This version is capable of correctly decoding non-iso-8859-1 characters.
	Non-iso-8859-1 characters are found in languages like russian,
	chinese, etc.
	So if you're clients will only submit forms with latin characters
	you can use the default implementation.
	The reason there are 2 different versions of the servlets is that
	the decoding of these other characters leads to a rather unpleasant
	performance penalty, as every submitted character is converted to a
	String before it is added to the result.
	

Building the classes
====================
First of all: compiled versions of the classes are included in the form of servlet-2.0.jar and servlet-2.1.jar, so if you want to use the classes building them is not necessary. See *Installing the classes*.

If you still want to build the classes all you have to do is type:

	make

This will build servlet-2.0.jar and servlet-2.1.jar if you have the make program. This program is present on virtually every unix system, but windows users have to download it. For instance in the cygwin package from www.cygnus.com.

Troubleshooting building
========================
Both servlet versions are generated from the same source code.
In this source code tags like #ifdef VERSION_2_1 ... #endif are placed.
The utility util/GenerateSource.class is used to generate the source code for the desired version from the common source code.

If this fails there are several things you can try:

 - If the GenerateSource class is not in your CLASSPATH you can add it manually.

 - If the GenerateSource class refuses to work from the Makefile you can call it manually. Documentation on the usage of GenerateSource is in the util directory
or otherwise in the form of javadoc in GenerateSource.java.

 - If the whole GenerateSource thing refuses to work at all you can use the
 generate-version.pl perl script. Before the GenerateSource java program I made a perl script as a proof of concept for the whole #ifdef idea. The script, while less sophisticated, is included in the distribution and can be used to generate the source code.

The second stage consists of compiling all the java source files in both the servlet and servlet/http directory.
The thing to remember here is that you have to call javac like this:
javac -classpath ../..:$CLASSPATH in the servlet directory, and javac ../../..:$CLASSPATH in the http directory. (javac -classpath ..\..;%CLASSPATH% and javac -classpath ..\..\..;%CLASSPATH% respectively for win32 users). This is to include javax.* in the classpath while compiling.

The final phase consists of creating jar files from the compiled classes.
This is consists of calling jar -c0f servlet-2.0.jar javax/servlet/*.class javax/servlet/http/*.class to create the servlet 2.0 jar file and jar -c0f servlet-2.1.jar javax/servlet/*.class javax/servlet/http/*.class to create the 2.1 one.

good luck.