How do I Compile the Servlet Source Code Within Pro Web JSP Sample Pages?
Associated product(s): Product name: Pro Web | Implementation: Web API
Views: 640 | Created: 2 years ago | Last updated: 2 years ago
If utilising the JSP Sample pages, you may find that you need to make some customisations to the servlet code. The source code for the JSP pages and servlets is all open source, and as such, you may make the customisations yourself, and then recompile the servlet source code, and implement the changes yourself.
The servlet source code can be found within the JSP sample pages in the following folder:
WEB-INF\src\com\qas\proweb\servlet
Once you have made the necessary changes to the servlet source code, you will need to ensure that you have the following in order to compile the servlet code:
- The Java Software Development Kit (SDK) 1.4 or later *
- A Java compiler (included with the Java SDK)
- The following .jar class files: **
o Axis.jar
o Commons-discovery.jar
o Commons-lang-2.0.jar
o Commons-logging.jar
o Jaxrpc.jar
o Saaj.jar
o Servlet.jar
o Wsdl4j.jar
* The Java Runtime Environment (JRE) can not be used instead of the Java SDK. The servlet code has been compiled on versions 1.4.x and 1.5 of the SDK, other versions are untested. You should ensure that the path to your java compiler (generally the bin folder within your Java SDK installation) is set on your system path.
** These classes can be found within your proweb JSP folder in WEB-INF\lib, and also in your Tomcat folder within common\lib.
Method
- Copy all the .jar class file dependencies (see above), and the .java servlet to a suitable working folder (in this example, the folder is C:\servlet)
- Open a command prompt window (Start à Run à cmd)
- Change to your working folder (C:\servlet) containing the .jar class files, and the .java Servlet files that you wish to compile
- From the command prompt, execute the following command line:
o javac -classpath C:\servlet\axis.jar;C:\servlet\commons-discovery.jar;C:\servlet\commons-lang-2.0.jar;C:\servlet\commons-logging.jar;C:\servlet\jaxrpc.jar;C:\servlet\saaj.jar;C:\servlet\servlet.jar;C:\servlet\wsdl4j.jar;c:\servlet *.java
If the compile succeeds, no errors will be returned, and the cursor should return to the command prompt (see below).

Once the files have been compiled, you will find new .class files have appeared in your working folder (c:\servlet). These files will need to be moved to the following location within your proweb JSP folder:
WEB-INF\classes\com\qas\proweb\servlet
Once you have done this, you should be able to restart your Java web server, and utilise the customisations that you have made to the servlets.
For further assistance with Pro Web V5, please visit the Pro Web Zone
Send to friend