Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function split() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 101

Deprecated: Function eregi_replace() is deprecated in /home3/vvaswani/sql.php on line 301

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 107

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 109

Deprecated: Function ereg_replace() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 124

Deprecated: Function ereg_replace() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 125

Deprecated: Function split() is deprecated in /home3/vvaswani/public_html/community/columns/trog/article.php on line 127

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174

Deprecated: Function ereg() is deprecated in /home3/vvaswani/db-mysql.php on line 174
The Melonfire Community - Trog
Logo         Community
  Trog
Services
The Company
Community
Columns
Your Account
Contact Us
 
 
Slapping Together A JSP Development Environment
Get a JSP development environment up and running on your Windows/Linux box in thirty minutes flat.

| One Tomcat, Standing Alone |

The first thing you need to do is set up the JDK. Double-click the installable file you just downloaded, and let the program install itself into a convenient location on your hard drive. I'll assume you've installed it to C:\JDK\

Next, go ahead and install Apache - the default installation location of C:\PROGRAM FILES\APACHE GROUP\APACHE\ is fine - and modify the configuration file "httpd.conf" in case you need to customize its operation. You should test that the server is running by starting it up and pointing your browser to http://localhost/ - if you see an Apache test page, that means your server is up and running. You'll also see an MS-DOS window which displays a status message like this:


C:\> APACHE
Apache/1.3.14 (Win32) running...


Third step: install the Tomcat Web server. Now, Tomcat comes as a single compressed file, which contains both Linux and Windows versions. You don't need to run an installation program; just unzip it to a convenient location and you're done. I used C:\TOMCAT\ as the location for my Tomcat installation.

At this point, it's time to see if the Tomcat server is working (Tomcat works independently of Apache as well). Pop open an MS-DOS window, and set up a few of the environment variables Tomcat needs to function correctly.


C:\> SET JAVA_HOME=C:\JDK

C:\> SET TOMCAT_HOME=C:\TOMCAT

C:\> SET PATH=%PATH%;C:\JDK\BIN


Obviously, you need to replace the locations above with the actual file paths on your system.

Once that's done, change to the Tomcat BIN\ directory and start Tomcat.


C:\TOMCAT\BIN> TOMCAT START


If all went well, you should see something like this:


Including all jars in C:\TOMCAT\LIB in your CLASSPATH.

Using CLASSPATH:
C:\TOMCAT\CLASSES;C:\TOMCAT\LIB\ANT.JAR;C:\TOMCAT\LIB\JAXP.JAR;C:\TOMCAT\LIB
\SERVLET.JAR;C:\TOMCAT\LIB\PARSER.JAR;C:\TOMCAT\LIB\WEBSER~1.JAR;C:\TOMCAT\L
IB\JASPER.JAR;C:\JDK\LIB\TOOLS.JAR

Starting Tomcat in new window


You should also see a new MS-DOS window with something like this displayed in it:


2001-01-30 02:47:19 - ContextManager: Adding context Ctx( /examples )
2001-01-30 02:47:19 - ContextManager: Adding context Ctx( /admin )
Starting tomcat. Check logs/tomcat.log for error messages
2001-01-30 02:47:20 - ContextManager: Adding context Ctx(  )
2001-01-30 02:47:20 - ContextManager: Adding context Ctx( /test )
2001-01-30 02:47:22 - PoolTcpConnector: Starting HttpConnectionHandler on 8080
2001-01-30 02:47:22 - PoolTcpConnector: Starting Ajp12ConnectionHandler on
8007


This indicates that the Tomcat server is running on port 8080.

If, on the other hand, you got this:


Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space
Out of environment space


then there's one more thing you need to do. Close the MS-DOS prompt, move to Windows Explorer, and create a new "MS-DOS Prompt" shortcut (you can copy the one in the Start-> Programs menu if you like). Right-click the shortcut, find the Memory tab, and change the "Initial Environment" memory size from "Auto" to the maximum (usually 4096 KB). Save the changes to your shortcut, use it to open up a new MS-DOS window, set the environment variables as described above, and try running Tomcat again. This time, things should work as advertised.

Quick aside: since the variables you set are destroyed each time you exit an MS-DOS session under Windows, I'd recommend that you add them to your C:\AUTOEXEC.BAT startup file so that they are permanently installed in memory. Or you could write a simple batch file which creates and sets the
variables in MS-DOS before running Tomcat each time.

In order to test your Tomcat installation, point your browser to http://localhost:8080/ and try browsing through the various JSP examples available on the default page at http://localhost:8080/examples/jsp/

Alternatively, you could create a simple JSP file called "hello.jsp" in the directory C:\TOMCAT\WEBAPPS\EXAMPLES\JSP\, containing the following JSP code:


<html>
<body>
<%
out.println("Waiter, can I have a cup of Java, please?");    
%>
</body>
</html>


And now, when you point your browser to http://localhost:8080/examples/jsp/hello.jsp, you should be presented with a page which looks like this:


<html>
<body>
Waiter, can I have a cup of Java, please?

</body>
</html>


If it works, take a deep breath - you're halfway there! Next, you need to get Apache talking with Tomcat, so that you don't need to add the :8080 suffix each time you want to execute a JSP document.


How to do Everything with PHP & MySQL
How to do Everything with PHP & MySQL, the best-selling book by Melonfire, explains how to take full advantage of PHP's built-in support for MySQL and link the results of database queries to Web pages. You'll get full details on PHP programming and MySQL database development, and then you'll learn to use these two cutting-edge technologies together. Easy-to-follow sample applications include a PHP online shopping cart, a MySQL order tracking system, and a PHP/MySQL news publishing system.

Read more, or grab your copy now!


previous page more like this  print this article  next page
 
Search...
 
In trog...
Logging With PHP
Building A Quick-And-Dirty PHP/MySQL Publishing System
Output Buffering With PHP
Date/Time Processing With PHP
Creating Web Calendars With The PEAR Calendar Class
more...
 
In the hitg report...
Crime Scenes
Animal Attraction
Lord Of The Strings
more...
 
In boombox...
Patience - George Michael
Think Tank - Blur
My Private Nation - Train
more...
 
In colophon...
Hostage - Robert Crais
The Dead Heart - Douglas Kennedy
Right As Rain - George Pelecanos
more...
 
In cut!...
American Chai
The Core
Possession
more...
 
Find out how you can use this article on your own Web site!


Copyright © 1998-
Strict Standards: mktime(): You should be using the time() function instead in /home3/vvaswani/public_html/community/columns/trog/article.php on line 731
2018 Melonfire. All rights reserved
Terms and Conditions | Feedback