We are going to use Eclipse to make the Web Development. Web Development has static web development which focus only on HTML web page, while dynamic web development focus on the interaction between web page and back end database/Servlet/…
The platform we use is Eclipse Java EE package, Tomcat Web Server, and database (MySQL we will worry about it later).
- Install Java. Download for Windows, MacOS, Linux, and Solaris from http://www.oracle.com/technetwork/java/javase/downloads/. You want the full JDK (with compiler), not just the JRE (for running existing apps). Accept all defaults when installing. In this tutorial, we use JDK 8, which you can find it in http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
- Unzip Tomcat. Unzip tomcat-7.0.34-preconfigured.zip into the location of your choice. I use the top level of the C drive, which results in C:\apache-tomcat-7.0.34. In this tutorial we use tomcat 7.0.77 which you can download from https://tomcat.apache.org/download-70.cgi
download zip file and unzip them in your C:/tomcat7
- Install and start Eclipse. Download from http://www.eclipse.org/downloads/. Choose “Eclipse IDE for Java EE Developers”, download, and unzip. In this tutorial you can find your installation from the link https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/neon1
the installation is different between MacOS and Windows. For Windows you have to do unzip; for MacOS, double click then install to the application.
- The First Web in Eclipse
- Open Eclipse–>New–>Other… –>
- Select a wizard –> Web —> Dynamic Web Project
- Dynamic Web Project: MyWeb. Since we are using Tomcat to be our Web Server, we can define Target Runtime by choosing New Runtime …
- Choose Apache Tomcat v7.0, then next
- We need to browse to Tomcat installation directory, which is where you unzip tomcat package
- click next >
- Context roo is MyWeb. The Content directory is WebContent, where we usually put our web files in
- Now we can develop our first web site: MyWeb. Right click WebContent folder, choose New –>HTML File
- File name is index.html
- Choose html 5
- We modify title as MyWeb between <title> </title>. In <body> </body>, insert a
My First Web!
and then save
- right click the web project MyWeb, choose Run As –> Run on Server –>
- Choose the localhost Tomcat v7.0 Server at localhost, click next –>
- Choose MyWeb (Since we don’t have any other web, we have nothing to do but click next)
- Web project MyWeb is deployed in localhost and run in the web browswer
- You are correct if you can see the same screen like below: MyWeb is the title, and My First Web! is what we inserted into the body!