The relevant contents of JDK, refer to http://hi.baidu.com/innuyasha/blog/item/db12f21f1d7e05f4e1fe0b30.html and http://hi.baidu.com/ Innuyasha/blog/item/b40eb011656f987fcb80c41e.html
Second, Eclipse
http://www.eclipse.org/downloads/
According to your operating system select the version you want to download and then directly unzip to use, no installation.
Third, MyEclipse
MyEclipse official website http://www.myeclipseide.com/
MyEclipse download Page http://www.myeclipseide.com/module-htmlpages-display-pid-4.html
Select the appropriate myeclipse download according to your version of Eclipse, whichever version you download, before you select accept License agreement to download. After entering the download page, select the appropriate version according to your own operating system, each version corresponding to the download of the corresponding version of the JDK, Eclipse, MyEclipse package, and another download is a separate myeclipse download.
After the download is complete, double-click Install, note that during the installation process, one step is to let you choose the installation path of Eclipse, if eclipse you unzip the D disk, then the path is selected in D:\eclipse, so that the myeclipse can be automatically associated with Eclipse. You will then be asked to choose the MyEclipse installation path. It is ready to run after installation. However, this is not a registered version, you can use the Registrar provided below to register.
MyEclipse 6.0 keygen http://cnjoyfun.googlepages.com/MyEclipse6.0M1keygen.zip
After unpacking, run the. jar file, select 5.5GA & Last, Professional, and then fill Subscriber and then point generate to generate subscription Code, The corresponding subscriber and subscription code to copy down, turn off the keygen, open myeclipse in the sign out of the registration prompt to choose Enter * (Behind the things forget what is, hehe), Then enter the contents of the Subscriber and Subscriber code, and the Finish button will register successfully when clicked. (I first in the case of the network and open the registration machine is not successful registration, the second time directly in the network and shut down the registration machine in the case of successful registration, as to know which factors affect I did not try, if you do not register success, from these two aspects to find the reason it)
Third, Tomcat
Official website http://tomcat.apache.org/
5.5.25 Http://apache.mirror.phpchina.com/tomcat/tomcat-5/v5.5.25/bin/apache-tomcat-5.5.25.exe
6.0.14 Http://apache.mirror.phpchina.com/tomcat/tomcat-6/v6.0.14/bin/apache-tomcat-6.0.14.exe
The compressed package I originally downloaded was not successfully installed, so I use the. exe to install it, and the. exe is given above. Install after download, one step will require the installation location of the JRE, this will generally automatically locate the location of the JRE. After installation, make the appropriate settings in the system variables.
On the My Computer, right-click Properties, Advanced, environment variables (N). In the following system variable, create a new system variable catalina_home:d:\jakarta-tomcat-5.0.30 (this is the location where you just installed Tomcat, assuming you just put it on the D drive).
Edit the value of the system variable path, in the "%java_home%\bin;" After adding the following:%catalina_home%\bin;
A new classpath has been created in the JDK settings, at which time the Classpath is edited, followed by the following input:%catalina_home%\common\lib\servlet-api.jar;
You can then start Tomcat, Access http://localhost:8080 in IE, and if you see the Tomcat Welcome page, the installation is successful.
Create your own JSP app directory
1. To the WebApps directory of the Tomcat installation directory, you can see Root,examples, tomcat-docs such as the directory of Tomcat;
2. Create a new directory under the WebApps directory named MyApp;
3.myapp Create a new directory Web-inf, note that the directory name is case-sensitive;
4.web-inf Create a new file, Web. XML with the following content:
<?xml version= "1.0" encoding= "Iso-8859-1"?>
<! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"Http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>my Web application</display-name>
<description>
A Application for test.
</description>
</web-app>
5. Create a new test JSP page under MyApp with the file name index.jsp and the file content as follows:
Now time is: <%=new java.util.Date ()%>
</center></body>
6. Restart Tomcat
7. Open the browser, enter http://localhost:8080/myapp/index.jsp to see the current time, the description is successful.
To build your own servlet:
1. Create a new servlet program with your most familiar editor (recommended Java IDE with Syntax checker), with the file name Test.java and the file contents as follows:
Package test;
Import java.io.IOException;
Import Java.io.PrintWriter;
Import javax.servlet.ServletException;
Import Javax.servlet.http.HttpServlet;
Import Javax.servlet.http.HttpServletRequest;
Import Javax.servlet.http.HttpServletResponse;
public class Test extends HttpServlet {
protected void doget (HttpServletRequest request, httpservletresponse response)
Throws Servletexception, IOException {
PrintWriter Out=response.getwriter ();
Out.println ("Out.flush ();
}
}
2. Compiling
Place Test.java under C:\Test and compile with the following command:
C:\test>javac Test.java
A compiled servlet file is then generated under C:\Test: Test.class
3. Cut the structure Test\test.class to%catalina_home%\webapps\myapp\web-inf\classes, that is, cut the Test directory into the classes directory, if the classes directory does not exist, Just create a new one. Now there's a Test\test.class file directory structure under Webapps\myapp\web-inf\classes.
4. Modify Webapps\myapp\web-inf\web.xml, add Servlets and servlet-mapping
The edited web. XML is as follows:
<?xml version= "1.0" encoding= "Iso-8859-1"?>
<! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"Http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>my Web application</display-name>
<description>
A Application for test.
</description>
<servlet>
<servlet-name>Test</servlet-name>
<display-name>Test</display-name>
<description>a Test servlet</description>
<servlet-class>test. Test</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Test</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>
</web-app>
The servlet in this passage declares the servlet you want to invoke, while servlet-mapping is "mapping" the declared servlet to the address/test
5. OK, restart Tomcat, launch the browser, enter Http://localhost:8080/myapp/Test if you see the output of this is a servlet Test. The servlet written is successful.
Note: Modify the Web. XML and the new class to restart Tomcat
To build your own bean:
1. Create a new Java program with your most familiar editor (recommended Java IDE with Syntax checker), with the file name Testbean.java and the file contents as follows:
Package test;
public class testbean{
Private String name = NULL;
Public Testbean (String strname_p) {
this.name=strname_p;
}
public void SetName (String strname_p) {
this.name=strname_p;
}
Public String GetName () {
return this.name;
}
}
2. Compiling
Place Testbean.java under C:\Test and compile with the following command:
C:\test>javac Testbean.java
A compiled bean file is then generated under C:\Test: Testbean.class
3. Cut the Testbean.class file to%catalina_home%\webapps\myapp\web-inf\classes\test,
4. Create a new testbean.jsp file with the following file contents:
<%@ page import= "test. Testbean "%>
<%
Testbean testbean=new Testbean ("This is a test Java bean.");
%>
Java Bean name is: <%=testbean.getname ()%>
</center></body>
5. OK, restart Tomcat, launch the browser, enter http://localhost:8080/myapp/TestBean.jsp if you see the output Java Bean name Is:this is a test Java bean. In the description of the written B EAN was successful.
This completes the configuration of the JSP, Servlet, and JavaBean under Tomcat as a whole. The next thing to do is to read more books, read other people's good code, self-write code to enhance their ability to develop in this area.
Four, Tomcat plug-in
Tomcat Plugin: http://www.eclipsetotale.com/tomcatPlugin.html
Depending on your version of Eclipse, select the appropriate plugin and extract it directly to the plugins directory in the Eclipse installation directory.
Open Eclipse and check Tomcat in the list on the left of Window->customize Perspective->commands
In Window->preferences, click Tomcat in the list on the left, select the version of Tomcat and the installation path, and the Tomcat profile will be automatically retrieved. Other options are available by default. Click OK and you'll see the Tomcat flag in the Eclipse's toolbar, where you can run Tomcat in Eclipse.
Configuring the Java Development environment