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 的路径输入即可



目录
相关文章
|
27天前
Error:(56, 18) 错误: com.newCallblack.callshow.util.DownloadUtil cannot be provided without an @Inject
Error:(56, 18) 错误: com.newCallblack.callshow.util.DownloadUtil cannot be provided without an @Inject
10 0
|
4月前
|
小程序 前端开发 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路由配置方
52 1
|
11月前
Error: undefined method `launchd_service_path‘ for xxx
使用brew命令进行启动就报错。
200 0
|
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的解决方法
2857 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**解决办法
375 0
报错:No fallback instance of type class**解决办法
Gradle sync failed: Unsupported method: NativeArtifact.getSourceFolders().
Gradle sync failed: Unsupported method: NativeArtifact.getSourceFolders().
71 0
|
Java Android开发
Bad method handle type 7异常解决
在利用androidx版本写demo时,在添加了一些依赖后,遇到了`java.lang.ClassNotFoundException`bug,这就很奇怪了,我就添加rxjava3的依赖,就给我报这个错误。
解决办法:找不到g_type_check_instance_cast
解决办法:找不到g_type_check_instance_cast
101 0
Unknown run configuration type AndroidRunConfigurationType的解决办法
Unknown run configuration type AndroidRunConfigurationType的解决办法
81 0
关于 QNetworkManager出现“QSslSocket: cannot call unresolved function SSLv23_client_method“ 的解决方法
关于 QNetworkManager出现“QSslSocket: cannot call unresolved function SSLv23_client_method“ 的解决方法
关于 QNetworkManager出现“QSslSocket: cannot call unresolved function SSLv23_client_method“ 的解决方法