在運行java中HttpSessionListener監聽器時,運行報錯:嚴重:?StandardWrapper.Throwablecom.sun.jersey.api.container.ContainerException:?The?ResourceConfig?instance?does?not?contain?any?root?resource?classes.以下是監聽器程序:package?Listener1;
import?javax.servlet.annotation.WebListener;
import?javax.servlet.http.HttpSessionEvent;
import?javax.servlet.http.HttpSessionListener;
@WebListener
public?class?HSL?implements?HttpSessionListener?{
private?int?ub;
@Override
public?void?sessionCreated(HttpSessionEvent?se)?{
ub++;
se.getSession().getServletContext().setAttribute("ub",?ub);
}
@Override
public?void?sessionDestroyed(HttpSessionEvent?se)?{
ub--;
se.getSession().getServletContext().setAttribute("ub",?ub);
}
}
求大神指點哪里錯誤?。。。?!非常感謝?。。?!
添加回答
舉報
0/150
提交
取消