在Netbeans中,“它不是web.xml中指定的servlet”错误

时间:2013-10-22 16:28:48

标签: java servlets web.xml pojo

我已经创建了一个简单的Servlet,它正在访问Netbeans中的POJO对象方法。我已经在web.xml中添加了Servlet详细信息但是在运行servlet类时它给出了错误

neither a main nor it is a servlet specified in web.xml

这是我的servlet类代码..

public  class Service extends HttpServlet {
  protected void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        try {
            BLC blc = new BLC();
            blc.captureCDRProcess();
        } catch (Exception ex) {
            System.out.println(ex);
        }
  } 
}

这是我的Web.xml代码..

 <servlet>
    <servlet-name>Service</servlet-name>
    <servlet-class>pojoserv.Service</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>Service</servlet-name>
    <url-pattern>/Service</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>

0 个答案:

没有答案