servlet解析不出来解决方法(is not a known servlet. Servlets belong in the classpath, often in WEB-INF/classes)

来源:互联网 发布:大数据与统计新思维 编辑:程序博客网 时间:2024/06/05 18:18

‘’is not a known servlet.  Servlets belong in the classpath, often in WEB-INF/classes.
面对这种情况,本人解决的方法,目前有两个,陆续更新中。。。

1.查看自己的web.xml文件,开始有段这样的话
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
 xmlns="http://java.sun.com/xml/ns/j2ee" -------------------------------》这里原来是javaee ,将其改为j2ee。
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

 

基本上是解决了。如果还是提示有问题。

2.查看自己的servlet路径,也是在web.xml中

  <servlet>

    <servlet-name>AjaxServer</servlet-name>
    <servlet-class>servlet.AjaxServer</servlet-class>---------------------》一定要对应自己的类得路径。
  </servlet>

目前我经过这两部检查都解决了。希望帮到你们。