建立 eclipse-jee-helios+Tomcat 7.0的JSP开发环境

写这个文章的原因是eclipse-jee下创建Tomcat server的资料太少了,可能因为太简单了大牛们都不愿意写吧。

我是新手,初次接触JAVA和JSP,在这个环节上遇到了问题,所以记录下来供大家参考。

 

java的环境不介绍了,相信各位都配置好了。

我下载了最新版本的 eclipse-jee和Tomcat server(eclipse-jee-helios-SR2-win32.zip和Tomcat 7.0),安装后http://localhost:8080能显示正确的页面。 使用eclipse编写了hello.jsp放在 在 D:/Tomcat 7.0/webapps/myhello下面

输入 http://localhost:8080/ myhello /hello.jsp 也能正常访问。

 

每次写完JSP都要这样调试太麻烦了,下面进入主题, eclipse-jee下创建Tomcat server。

 

先阅读eclipse的help:

"Creating a Tomcat server

...
To create a Apache Tomcat server:

1.In the Servers view, right-click and select New > Server. The Define a New Server wizard opens.
2.In the Select the server type list, select the Tomcat server defined in the previous step.
Tip: If you did not specify the Tomcat install directory, the Define a New Server wizard will prompt you for this information.
3.Start the Tomcat server. In the Servers view, right-click the Tomcat server and select Start.
4.Test your setup of the Tomcat server.
a.Open a Web browser.
b.Type the Web address http://localhost:8080/. If you see the Apache Tomcat start page, you have successfully set up your Tomcat server.

"

对于最后,测试在eclipse-jee下创建Tomcat server是否成功,我是这样做的:

在SERVER面板上右键,执行 start。结果却提示:8005、8080、8009端口冲突。分析:既然创建了新的SERVER,那么当前运行的SERVER停止, 新的SERVER才能启动吧。于是我停止了 当前运行的SERVER(D:/Tomcat 7.0),然后再 在SERVER面板上右键,执行 start。一串红的ERROR的调试信息后,eclipse中的SERVER状态变为[started,synchronized]----原来是 [stopped,synchronized]

 

eclipse中的SERVER状态变为[started,synchronized],点击工具栏上的绿色运行按钮,我建立的hellojsp (dynamic web project) 就有正确输出了。

 

zxyu 2011-5-28

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章