Cnet jsp basic: Install JSP

Source: Internet
Author: User
Tags website server

You will need Java 2 software development tool (JSDK). Its original names are Java Development Tool (JDK), JavaServer website development tool (JSWDK), Tomcat, or other network servers supporting JSP. Sun provides JSDK and JSWDK for Windows, Solaris, and Linux for free.

If you want to use JSP on your current server, but the server itself does not support JSP and Java servlets, you can try Allaire's Jrun, it serves as an additional network server device for Netscape Enterprise Edition and FastTrack servers, Microsoft Web servers (IIS) and personal Web servers (PWS), Apache, and other servers. You can also use the Java version of Apache network server, which is available in the latest JSWDK.

Download and install the components you need
Currently, the 1.2.2-001 and JSDK downloadable versions are in the form of installable compression files. The downloaded file is about 20 MB, providing a complete Java development environment, allowing you to build a Java solution that uses standard APIs as the core. However, the only thing your network server needs to apply to JSP is the Java compiler. To let the network server know the compiler location, set the environment variable JAVA_HOME to the jsdk installation directory. If you install the program on Windows and accept the preset directory, add the code set JAVA. HOME = C: 1.2.2 to your autoexec. bat file and restart the file.

After JSDK is installed, download and install JSWDK or beta Tomcat, which is a Java-based Apache network server. It doesn't matter where it is installed, but you can find it. In general, it will be placed in the upper-layer Directory, which allows you to replace the network server of JSWDK or JSDK without moving other network servers. After installing this file, you can use JSP.

After JSWDK is correctly installed, run the startserver command file to start the network server. The default communication port is 8080. It depends on whether the server is correctly installed after it is started. You can load any of the sample JSP files (http: // localhost: 8080/examples/jsp /). If you can successfully execute an example file, you can know that you have set the software correctly. If you see an error message in the console window of the startup server, you need to solve this problem. The most common problem is that the JAVA_HOME environment variable is not set (or incorrect. To view the current environment settings, type set in DOS mode.

Start
Before interpreting JSP syntax, create a quick web page that displays the current date and time and save it as sample. jsp:

<Html>
<Head>
<Title> First Page </title>
</Head>
<Body>
<H3> Today is:
<% = New java. util. Date () %>
</H3>
</Body>
</Html>.

Put this file and all your HTML and JSP pages in the webpage directory under your JSWDK installation directory. you can go to http: // localhost: 8080/sample. jsp download this page. when you visit this webpage for the first time, the website server translates JSP into a Java servlet code, and you will see the current date and time.

Now that you have downloaded, installed, and built a good development environment, you are ready to understand the JSP syntax and build your own JSP-based solutions.


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.