Eclipse+Tomcat+Lomboz搭建Jsp、Servlet和JavaBean环境

请高手们请教:我用J2sdk1.4.2+Eclipse3.0.1+Tomcat5.0搭建Jsp环境,并补上了Lomboz3、emf、tomcatPluginV3等插件,可... 请高手们请教:我用 J2sdk1.4.2+Eclipse3.0.1+Tomcat5.0搭建Jsp环境,并补上了Lomboz3、emf、tomcatPluginV3等插件,可Lomboz-〉Server Definitions配置时选中Tomcat5 设置以后,按下Apply按钮,OK后重新进去看Lomboz-〉Server Definitions总是原先的默认值!!!到底出了什么问题?
还有Servlet和JavaBean环境的配置时要测试的Text.Java程序无法编译,
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("<html>");
out.println("<body>");
out.println("<h1>This is a servlet test.</h1>");
out.println("</body>");
out.println("</html>");
out.flush();
}
}

出现如下提示:
C:\Test>javac Test.java
Test.java:4: package javax.servlet does not exist
import javax.servlet.ServletException;
^
Test.java:5: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
^
Test.java:6: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
^
Test.java:7: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
^
Test.java:8: cannot resolve symbol
symbol : class HttpServlet
location: class test.Test
public class Test extends HttpServlet {
^
Test.java:9: cannot resolve symbol
symbol : class HttpServletRequest
location: class test.Test
protected void doGet(HttpServletRequest request, HttpServletResponse res
ponse)
^
Test.java:9: cannot resolve symbol
symbol : class HttpServletResponse
location: class test.Test
protected void doGet(HttpServletRequest request, HttpServletResponse res
ponse)
^
Test.java:10: cannot resolve symbol
symbol : class ServletException
location: class test.Test
throws ServletException, IOException {
^
8 errors

可HelloWorld.java能编译的,还有打开Tomcat5.0后
C:\Tomcat 5.0\webapps\jsp-examples里的测试程序能在IE浏览器里通过
C:\Tomcat 5.0\webapps\myapp里的测试不能通过!
谢谢高手们~
展开
 我来答
百度网友71cb07691
2006-09-02 · TA获得超过2381个赞
知道小有建树答主
回答量:1686
采纳率:0%
帮助的人:0
展开全部
5月25日 09:28 从新再装一次吧,在试试把jdk换成1.5的试试,eclipse有时候很多问题,新手往往不知道怎么回事,莫名其妙的,再装一次,我当时就装了好几次,呵呵,比较麻烦~:)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式