JSP development entry (1) ---- 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, 1.2.2-001 is released. The jsdk downloadable version is in the form of installable compression. 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 it on Windows and accept the default directoryProgramCodeSet java. Home = c: \ 1.2.2 is added to your autoexec. BAT file and restarted.
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>
</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 will translate JSP into Java Servlet program code, then you will see the current date and time.
now you have downloaded, installed, and built a development environment. You are ready to understand JSP syntax and build your own JSP-based solutions.