Install your machine to use JSP

Source: Internet
Author: User
Tags date variable tomcat

Introduction to JSP development (i)----Install your machine to use JSP


You will need the Java 2 Software development tool (JSDK), its original name is 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 Web server, but the server itself does not support JSP and Java Servlets, you can try Allaire's jrun, which acts like a Netscape Enterprise Edition and FastTrack Server, Microsoft's Internet Information Server (IIS) and personal network server (PWS), Apache, and other servers of the network servers 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 downloadable version of the currently published 1.2.2-001,JSDK is in an installable compression format. The downloaded file is approximately 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 needs 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 program 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 can prepare to develop JSP.
After you install the JSWDK correctly, execute the startserver command file to activate the network server with a preset communication port of 8080. To see you after activating the server is all C has the correct installation tool, you can load the sample JSP file any one (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 activation server, you need to resolve the problem. The most common problem is not setting (or incorrectly setting) environment variable 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 Program code, then 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.