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里的测试不能通过!
谢谢高手们~ 展开
还有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里的测试不能通过!
谢谢高手们~ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询