Install your machine to use JSP
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 that support JSP. Sun provides JSDK and JSWDK for Windows, Solaris, and Linux for free.
If you want to use JSP on your current network 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's Internet Information Server (IIS) and personal network server (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 required components
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 and accept the default directory on Windows, 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, and use Java as the main 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 you have installed this file, you can prepare to develop JSP.
After JSWDK is correctly installed, run the startserver command file to activate the network server. The default communication port is 8080. After activating the server, you must check that all C has the correct installation tool. 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 set the software correctly. If you see an error message in the console window of the activation server, you need to solve this problem. The most common problem is that the environment variable JAVA. HOME 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>
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.