Httpservlet cannot be resolved to a type的原因与解决方法

简介: <p>转自:<a target="_blank" href="http://blog.csdn.net/zhouyingge1104/article/details/7583511">http://blog.csdn.net/zhouyingge1104/article/details/7583511</a></p> <p></p> <p style="margin-top:0px;

转自:http://blog.csdn.net/zhouyingge1104/article/details/7583511

刚开始学习Servlet,在Eclipse中新建了一个Servlet,不过页面上报错:

      Httpservlet cannot be resolved to a type,显然是Eclipse找不到相应的包,即javax.servlet。


原因:

 jdk 里不包括servlet-api.jar 这个包,此包在Tomcat 中存在 

项目名--> 右键 

Property--> 选择 

Java Build Path--> 选择 

Add External JARs--> 选择 

把servlet-api.jar 的路径输入即可



目录
相关文章
‘;‘ expected,Missing semicolon.Syntax Missing semicolon multi (web,若依定义方法,修改method,之后在mounted()用this
‘;‘ expected,Missing semicolon.Syntax Missing semicolon multi (web,若依定义方法,修改method,之后在mounted()用this
Error: undefined method `launchd_service_path‘ for xxx
使用brew命令进行启动就报错。
241 0
|
11月前
|
小程序 前端开发 PHP
laravel8(一)Target class [XXXXXController] does not exist.错误的解决办法
Laravel 8配置好路由后,访问提示: arduino 复制代码 Target class [XXXXXController] does not exist. 错误。 出现这个错误的原因是Laravel8对路由命名空间做出了更新(详见:路由命名空间更新),而我们仍然在使用Laravel6或者7版本的方式写路由。 Laravel 8路由配置方式: php 复制代码 use App\Http\Controllers\UserController; Route::get('/users', [UserController::class, 'index']); Laravel 6/7路由配置方
144 1
|
JavaScript Java Spring
【异常】This application has no explicit mapping for /error, so you are seeing this as a fallback的解决方法
This application has no explicit mapping for /error, so you are seeing this as a fallback的解决方法
4208 0
【异常】This application has no explicit mapping for /error, so you are seeing this as a fallback的解决方法
|
Java 编译器 Spring
报错:No fallback instance of type class**解决办法
报错:No fallback instance of type class**解决办法
1099 0
报错:No fallback instance of type class**解决办法
|
Java Android开发
Bad method handle type 7异常解决
在利用androidx版本写demo时,在添加了一些依赖后,遇到了`java.lang.ClassNotFoundException`bug,这就很奇怪了,我就添加rxjava3的依赖,就给我报这个错误。
警告解决办法:class xxxx has virtual method but non-virtual destructor
警告解决办法:class xxxx has virtual method but non-virtual destructor
133 0
Unknown run configuration type AndroidRunConfigurationType的解决办法
Unknown run configuration type AndroidRunConfigurationType的解决办法
107 0
[Hyperf]Entry “xxxInterface“ cannot be resolved: the class is not instantiable
[Hyperf]Entry “xxxInterface“ cannot be resolved: the class is not instantiable
444 0
[Hyperf]Entry “xxxInterface“ cannot be resolved: the class is not instantiable
|
Java Spring
default constructor not found 异常解决方法
default constructor not found 异常解决方法
2145 0