java菜鸟的Editplus 2+Tomcat 的问题,大伙来看看

teli_eurydice 2004-09-15 09:05:54
参照这篇文章学习jsp http://www.itpub.net/249819.html

代码如下


import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Test extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{

response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html><head><title>");
out.println("This is my first Servlet");
out.println("</title></head><body>");
out.println("<h1>Hello,World!</h1>");
out.println("</body></html>");

}
}


错误为 Exception in thread "main" java.lang.nosuchmethodError:mian

网大虾赐教,不要刚学习就被打击信心了
...全文
108 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
luojx 2004-09-16
  • 打赏
  • 举报
回复
servlet不能直接运行!你是直接运行出的错,编译过去之后通过网页访问
chenyun2000 2004-09-15
  • 打赏
  • 举报
回复
你应该安装LOMOZ插件(J2EE插件),将Servlet部署到Tomcat上,通过浏览器执行,而不是用Eclipse的Run(这是运行Application的)
wishyouwerehere 2004-09-15
  • 打赏
  • 举报
回复
mian是什么啊
是不是打错了
chating 2004-09-15
  • 打赏
  • 举报
回复
不会java

要.net的还差不多。。
xiaxu_g 2004-09-15
  • 打赏
  • 举报
回复
估计是你的环境变量没设置好!
teli_eurydice 2004-09-15
  • 打赏
  • 举报
回复
呵呵,是
Exception in thread "main" java.lang.nosuchmethodError:main

我用的 Editplus 2啊,不是Eclipse

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧