長期以來,我們習慣使用myeclipse開發J2EE web程序。雖然myeclipse使用起來很方便,但它是收費的。
eclipse for j2ee 是免費的,並且足以保證我們平時的j2ee的開發,故推薦使用該版本的IDE.
eclipse官方網址:http://www.eclipse.org/
eclipse下載地址:http://www.eclipse.org/downloads/
打開eclipse, File>New>Dynamic Web Project, 新建一個動態Web項目,項目名自擬,如下所示:
在WebContent目錄下新建index.jsp
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
hello world! welcome to use eclipse j2ee.
</body>
</html>
啟動已配置好的Tomcat:
在瀏覽器里輸入網址:http://localhost:8080/WebHelloWorld_Eclipse_JavaEE/index.jsp,得到返回結果。