我的 web.xml 文件代码
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>com.vts.action.Server</listener-class>
</listener>
Server.java 代码....
public class Server extends HttpServlet implements ServletContextListener {
private static final long serialVersionUID = 1L;
Socket clientsocket;
ServerSocket socket = null;
int PORT = 9090;
@Override
public void contextDestroyed(ServletContextEvent arg0) {
// TODO Auto-generated method stub
System.out.println("ServletContextListener destroyed");
}
@Override
public void contextInitialized(ServletContextEvent arg0)
{
// hear code create socket server and accept multiple client connection and
String via gps and save string in database is working correctly
}
}
但是现在我的问题是我想通过在后台运行的 gps 接受继续字符串
但是 index.jsp 页面没有启动以为是我的欢迎文件。我不确定我的web.xml中的监听器配置是对还是错.....请给建议
感谢和问候
克里希纳坎特