Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/350.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用Netbeans 8.2在Maven中映射Servlet?_Java_Maven_Servlet Mapping - Fatal编程技术网

Java 如何使用Netbeans 8.2在Maven中映射Servlet?

Java 如何使用Netbeans 8.2在Maven中映射Servlet?,java,maven,servlet-mapping,Java,Maven,Servlet Mapping,我访问并试图实施 每当Servlet通过使用Neatbeans接口添加并驻留在project\u文件夹/src/main/webapp/web-INF/中时,My web.xml就会自动创建,并具有如下内容(默认由Netbeans创建)—— 如何部署应用程序?@XtremeBiker当我简单地点击localhost:8080/entry dispatch/时,欢迎页面成功呈现。这样做不需要部署描述符..如何实现AdminPathController?我使用netbeans接口添加AdminPat

我访问并试图实施

每当Servlet通过使用Neatbeans接口添加并驻留在
project\u文件夹/src/main/webapp/web-INF/
中时,My web.xml就会自动创建,并具有如下内容(默认由Netbeans创建)——


如何部署应用程序?@XtremeBiker当我简单地点击
localhost:8080/entry dispatch/
时,欢迎页面成功呈现。这样做不需要部署描述符..如何实现
AdminPathController
?我使用netbeans接口添加AdminPathController,为了映射web.xml,我在pom.xml中编写插件代码。。。。如手册所示@XtremeBiker我在上面的代码中出错了…好吧,实际上你需要一个servlet。。找到一个关于如何实现servlet的好教程(互联网上有几十个)。
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
    <servlet>
        <servlet-name>AdminPathController</servlet-name>
        <servlet-class>AdminPathController</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>AdminPathController</servlet-name>
        <url-pattern>/AdminPathController</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
</web-app>
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-war-plugin</artifactId>
   <version>2.4</version>
   <configuration>
      <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
   </configuration>
 </plugin>