CNET jsp BASIC: Installing JSP

Source: Internet
Author: User
Tags date tomcat
You will need the Java 2 Software development tool (JSDK), its original name being the Java development tool (JDK) and the JavaServer Web site development tool (JSWDK), Tomcat, or other Web servers that support JSP. Sun offers free jsdk and JSWDK for Windows,solaris, and Linux platforms for use.

If you want to use JSP on your current server, but the server itself does not support JSP and Java Servlets, you can try the JRun of Allaire, which acts like a Web server for Netscape Enterprise Edition and FastTrack Server, Microsoft ( IIS) with the Personal Web server (PWS), Apache, and other server's network server add-on devices. You can also use the Java version of the Apache Web server, which is available in the latest JSWDK.

Download and install the components you need
The currently published 1.2.2-001,JSDK downloadable version is in the form of an installable compression file. The downloaded archive is about 20MB, providing a complete Java development environment that allows you to build Java solutions that take advantage of standard APIs as the core. However, the only thing your Web server has to apply to JSP is the Java compiler. To have the network server know the location of the compiler, set the environment variable java_home to the JSDK installation directory. If you are installing and accepting a preset directory on Windows, set this line of code to JAVA. home=c:\1.2.2 add to your Autoexec.bat file and reboot.

After installing the JSDK, download and install the JSWDK or beta version of Tomcat, the Java-dominated Apache network server. Where the installation is not important, it is important that you can find it. In general, it is placed in the upper directory, which allows you to replace JSWDK or JSDK Web servers without the need to move other Web servers. After you have installed this file, you will be ready to use JSP.

After you install the JSWDK correctly, execute the startserver command file to start the network server with a preset communication port of 8080. To see if you installed correctly after starting the server, you can load any one of the sample JSP files (http://localhost:8080/examples/jsp/). If you can successfully execute an example file, you can know that you have correctly set the software. If you see the error message in the console window of the startup server, you have to solve the problem. The most common problem is not setting (or incorrectly setting) environment variables Java_home. To view the current environment settings, type set in DOS mode.

Begin
Before interpreting the JSP syntax, create a quick Web page that displays the current date and time and store it as a sample.jsp:

<title>first page</title>
<body>
<%= new Java.util.Date ()%>
</H3>
</body>

Put this file with all of your HTML and JSP pages in the directory of your JSWDK installation directory. You can download this page in http://localhost:8080/sample.jsp. When you first visit this page, the Web server will translate JSP into Java servlet code, and you will see the current date and time.

Now that you have downloaded, installed, and architected the development environment, you are ready to understand JSP syntax and build your own JSP-oriented solution.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.