亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

JS中HttpSessionListener

JS中HttpSessionListener

黃森huang 2016-11-22 11:08:55
信息:?Scanning?for?root?resource?and?provider?classes?in?the?Web?app?resource?paths: ??/WEB-INF/lib ??/WEB-INF/classes 十一月?22,?2016?11:02:11?上午?com.sun.jersey.server.impl.application.WebApplicationImpl?_initiate 信息:?Initiating?Jersey?application,?version?'Jersey:?1.4?09/11/2010?10:30?PM' 十一月?22,?2016?11:02:12?上午?com.sun.jersey.server.impl.application.RootResourceUriRules?<init> 嚴重:?The?ResourceConfig?instance?does?not?contain?any?root?resource?classes. 十一月?22,?2016?11:02:12?上午?org.apache.catalina.core.ApplicationContext?log 嚴重:?StandardWrapper.Throwable com.sun.jersey.api.container.ContainerException:?The?ResourceConfig?instance?does?not?contain?any?root?resource?classes. 下面是jsp文件: <%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%><!--<%@ page import="Listener_session.MyHttpsessionListener" %>--><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>? <head>? ? <base href="<%=basePath%>">? ? <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> ? ? <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> -->? </head>? <body>? ? <h1>這是項目統計在線人數</h1>? ? <hr>? ? 在線人數:${ub }? </body></html>代碼錯誤報告:com.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); } }
查看完整描述

3 回答

?
小草1434

TA貢獻106條經驗 獲得超23個贊

配置文件xml沒有按照層級一級一級來,比如第一個標簽<configutation>沒有

查看完整回答
反對 回復 2016-11-22
  • 黃森huang
    黃森huang
    求大神指點更具體一點信息 下面是Web.xml配置信息,求大神指點哪里錯誤 <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <display-name>Listener統計renshu</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <login-config> <auth-method>BASIC</auth-method> </login-config> <listener> <listener-class>listener.HSL</listener-class> </listener> </web-app>
  • 黃森huang
    黃森huang
    <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <display-name>Listener統計renshu</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <login-config> <auth-method>BASIC</auth-method> </login-config> <listener> <listener-class>listener.HSL</listener-class> </listener> </web-app>
  • 3 回答
  • 1 關注
  • 1913 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號