(Absolute Original) Step by Step How to write your first JSP + JavaBean + Tomcat program (I personally experience + instance tea

xiaoxiao2021-03-06  42

How (Original) Step By Step to write his first program Tomcat JSP JavaBean of (I examples of teaching experience) Author: albert_cheng need software: 1, j2sdk

Version: J2SDK1.4.1 (35.9MB)

Address: http://java.sun.com/j2se/1.4.1/download.html

2, Tomcat4

Version: 4.1.21 (8.33MB)

Address: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/3 ,ultraedit, this software is a personal, no download address ^ _ ^ Install the relevant software 1 Install J2SDK

Under Windows, run the downloaded J2SDK-1_4_1_01-windows-i586.exe file directly, install it to a directory according to the installation wizard, such as I installed to C: / J2SDK 1.4.1; 2, install Tomcat

Directly run download jakarta-tomcat-4.0.1.exe, follow the general Windows program installation steps to install Tomcat, which will automatically look for the position of J2SDK. For example, I installed C: / Program Files / Apache Group / Tomcat 4.1.3, I use the environment variable I use Win2000, just right-click My Computer, select "Properties" in the pop-up menu → "System Features" → "Advanced" → Environment Variables, popping up the environment variable dialog, you can edit the environmental variable of the system. Add PATH, JAVA_HOME, CLASSPATH and Tomcat_Home four variables, add value C: /J2SDK1.4.1/bin ,c: /j2sdk1.4.1, c: /j2sdk1.4.1/lib/tools.jar, C: / Program Files / Apache Group / Tomcat 4.1. After configuring, you need to restart your computer to make the environment variables take effect. 4. Configuring Tomcat is mainly to configure the following two 1. The Tomcat listener port Tomcat defaults to the 8080 port. If the other programs in the system are occupied, Tomcat cannot be successfully activated if other programs in the system before startup. Note: I have encountered this situation and toss an hour to change the configuration, and finally I found that the port is occupied. . . Modify the Tomcat primary /conf/server.xml file, such as I change the port parameter to 8000 Will be able to access http://127.0.0.1:8000/xxx/jsp/firstBean.jsp <3> to write Java code, and compile because it is test, use UltraEdit to write the HelloWorld code package test; public Class HelloWorld {public string str = "hello javabean"; public string getString () {Return Str;}


New Post(0)