我已经创建了一个简单的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>