java_web提示错误

错误1:
JSP页面顶端出现“红色”的报错信息:The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
办法:右击web工程-》属性或Build Path-》Java Build Path->Libraries-> Add Libray…->Server Runtime -》Tomcat Server;
切换到Java Build Path界面中的Orader and Export,选择Tomcat。

错误2:
Build path specifies execution environment JavaSE-1.6. There are no JREs installed in the workspace that are strictly compatible with this environment.
办法:右键Build Path-》Configure Build Path-》Remove the “JRE System Library[J2SE 1.5]”-> click “Add Library” button -> JRE System Library-> select the new “Executin Environment” or Workspace default JRE

错误3:
The method toLocaleString() from the type Date is deprecated deal.jsp /3/WebContent line 16 JSP Problem
办法:因为toLocaleString()方法老了不建议用,可以换成SimpleDateFormat类的方法

错误4:打开eclipse中Run on Server时,却显示“此程序无法显示网页”?
办法:首先关闭当前的tomcat服务器,之后在tomcat安装目录下tomcat/bin/tomcat7.exe双击,手动重新打开。此时在浏览器输入http://localhost:8080会出现tomcat起始迎接页,说明服务器已成功打开。

错误5:Several ports (8005, 8080, 8009) required by Tomcat v7.0 Server at localhost are already in use.
办法:启动任务管理器,结束javaw.exe

错误6:不能在45s内启动。还有启动后一直没反应
办法:重启电脑。也可以双击tomcat/bin/shutdown.bat来关闭tomcat试试,不行就算。

错误7:The method getRealPath(String) from the type ServletRequest is deprecated
办法:换个新方法 getServletContext().getRealPath(“index.jsp”)

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值