Latest web development tutorials

JSP development environment to build

JSP development environment is the place you used to develop, test and run JSP programs.

This section will take you to build JSP development environment, including the following steps.

If you are using the Eclipse environment, you can directly see: Eclipse the JSP / build the Servlet environment .


Configuring Java Development Kit (JDK)

This step involves configuring Java SDK download and PATH environment variable.

You can download the SDK from Oracle's Java page: Java SE Downloads

Java SDK After downloading, follow the given instructions to install and configure the SDK. Finally, set the PATH and JAVA_HOME environment variable to include java and javac specified folder path, usually java_install_dir / bin and java_install_dir.

If you are using a Windows system and SDK installation directory is C :: \ jdk1.5.0_20, then you need to C: \ autoexec.bat file, add the following two lines:

set PATH=C:\jdk1.5.0_20\bin;%PATH%
set JAVA_HOME=C:\jdk1.5.0_20

Or, in Windows NT / 2000 / XP, you can simply right-click on the My Computer icon, select Properties, then Advanced, then Environment Variables, then you can easily set the PATH variable and OK to exit on the line.

In Linux / Unix systems, if the SDK installation directory is /usr/local/jdk1.5.0_20 and using the C shell, then you need to add the following two lines in .cshrc file:

setenv PATH /usr/local/jdk1.5.0_20/bin:$PATH
setenv JAVA_HOME /usr/local/jdk1.5.0_20

Or, if you are using a similar Borland JBuilder, Eclipse, IntelliJ IDEA and Sun ONE Studio integrated development environment so you can try to compile and run a simple program to determine the IDE (Integrated Development Environment) is already known SDK installation directory .

In this step, you can also refer to our Java development environment configuration section of the tutorial.


Setting Web Server: Tomcat

Currently, there are a lot of support JSP and Servlets development Web server on the market. Some of them are available for free download and use, Tomcat is one of them.

Apache Tomcat is an open source software that can be run as a standalone JSP and Servlets server can also be integrated into the Apache Web Server in. Following is a Tomcat configuration methods:

  • Download the latest version of the Tomcat: http://tomcat.apache.org/ .
  • After downloading the installation files, extract the compressed files to a convenient place, such as under Windows C: \ /usr/local/apache-tomcat-5.5.29 directory apache-tomcat-5.5.29 directory or Linux / Unix under and then create a CATALINA_HOME environment variable to point to these directories.

Under Windows machine, Tomcat can be started by executing the following command:

%CATALINA_HOME%\bin\startup.bat
或者
C:\apache-tomcat-5.5.29\bin\startup.bat

In Linux / Unix machine, Tomcat can be started by executing the following command:

$CATALINA_HOME/bin/startup.sh
或者
/usr/local/apache-tomcat-5.5.29/bin/startup.sh

After a successful start Tomcat, by accessing http: // localhost: 8080 / you can use Tomcat that comes with some of the web apps. If all goes well, you should see the following page:

Find documentation for more information on configuring and running Tomcat can be provided in the Tomcat, Tomcat or go to the official website to view: http: //tomcat.apache.org.

Under Windows machine, Tomcat can be stopped by executing the following command:

%CATALINA_HOME%\bin\shutdown
或者
C:\apache-tomcat-5.5.29\bin\shutdown

In Linux / Unix machine, Tomcat can be stopped by executing the following command:

$CATALINA_HOME/bin/shutdown.sh
或者
/usr/local/apache-tomcat-5.5.29/bin/shutdown.sh

Setting the CLASSPATH environment variable

Because servlets are not part of Java SE, you must mark the servlet class compiler.

If you are using a Windows machine, you need to C: \ autoexec.bat file, add the following two lines:

set CATALINA=C:\apache-tomcat-5.5.29
set CLASSPATH=%CATALINA%\common\lib\jsp-api.jar;%CLASSPATH%

Or, in Windows NT / 2000 / XP, you can simply right-click My Computer, choose Properties, and then click Advanced, and then click Environment Variables, then they can set the CLASSPATH variable and determining the exit.

In Linux / Unix machine, if you are using the C shell, then you need to add the following two lines in .cshrc file:

setenv CATALINA=/usr/local/apache-tomcat-5.5.29
setenv CLASSPATH $CATALINA/common/lib/jsp-api.jar:$CLASSPATH

Note: If your development path is C: \ JSPDev (Windows) or / usr / JSPDev (Linux / Unix), then you'll need to add these paths CLASSPATH variable.