Creating a web application in Eclipse
Here's a simple example with a heading, a sub-heading and two paragraphs showing some placeholder text.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Dalton Used Car Emporium</title>
</head>
<body>
<h1>Welcome to the Dalton Used Car Emporium</h1>
<h2>If you don't want it, we probably do</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla consequat faucibus dictum. Nam varius urna velit.
</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla consequat faucibus dictum. Nam varius urna velit. Sed tincidunt sapien augue, eu rutrum quam imperdiet eu. Phasellus nunc nisi, commodo eget congue eget, rhoncus imperdiet arcu.</p>
</body>
</html>
Your assignment
You'll be working with web projects now. No more Java console applications.
- To create a web project from Eclipse, follow the following menu items: File | New | Other | Web | Dynamic Web Project.
- On the next form that comes up in Eclipse enter the project name and select the target runtime. For the target runtime select HTTP Preview. You may have to click the New Runtime button to select HTTP Preview.
- Create a new HTML page called index.html in Eclipse. Copy the above html code from above into the new page.
- To view your web page select it in the project explorer. Then right-click and select the option to run on the server. You may be prompted to install Tomcat at that point.
- Feel free to modify the text. We'll be making more changes in the upcoming assignments.