本人小白,用maven调用servlet出现500异常,求大神告诉我怎么解决?

使用maven调用servlet报错如下:
严重: Allocate exception for servlet myServlet
java.lang.ClassNotFoundException: com.web.s8 : 0 mervlet.myServlet

pom.xml中配置:

<dependencies>
<dependency>
<groupId>junit</groupId&8 ^ b ? E c ]gt;
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependencI % G )  Z o J qy>
<groupId>javax.servlet</groupId>
<artifactId>serv, w )  + ] jlet-api</artifactId>
<version>2.5<L V ;;/version>
&h # d . U 6 * /lt;scope>9 X  ^ = aprovid4 U eed</scope>
</dependency>
<dx 4 Uependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-apo j e x ni+ # p</artifactId>
<version>2.0</versiG R ) Qon>
<scope>provt K ` Mided</scope>
</dependency>
</dependencies>
web.xml中配置:
    <servlet^ 0 1>
<servlet-name>myServlet</servletY e ~ @ p S-name>
<servlet-class>com.web.servl2 x | O Xet.myServlet</sa F Y k N O wervlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/</url-pattern>
</sej ! * ) 9 W 6 9rvlet-mapping>

servlet中代码:

public class myServlet extends Ht[ # 9 vtpServlet {
protected void doPost(HttpServlet) R b c n @Request request, HttpServletResponse response) throws javax.servlet.ServletEx1 t xception, IOException {
this.doGet(request,response);
}
protected void doGet(HttpServletRequest request, HttpServletv X E f xResponse response) throws javK 1 ] Q t Eax.s; * K i c H j E )ervlet.ServletException, IOException {
request.getRequesR / TtDispatcher("/hello.jsp").forward(request,response);
}

本人小白,用maven调用servlet出现500异常,求大神告诉我怎么解决?

找到错误原因了:
因为没有把java文件放在main目录下导致找5 P ( D不到ServU ) ; Q ~let文件

回答