/** * ~写以下SessionCounter.java * q编译ؓSessiionCounter.class * 然后攑ֈ你的|站的classpath? * SessionCount(自己建立此目?下面 */ package SessionCount; import javax.servlet.*; import javax.servlet.http.*; public class SessionCounter implements HttpSessionListener { private static int activeSessions = 0; public void sessionCreated(HttpSessionEvent se) { activeSessions++; } public void sessionDestroyed(HttpSessionEvent se) { if(activeSessions > 0) activeSessions--; } public static int getActiveSessions() { return activeSessions; } } 接着建立online.jsp文g用于昄在线人数 <%@ page import="SessionCount.SessionCounter" %> 在线Q?lt;%= SessionCounter.getActiveSessions() %> 然后需要在你的|站的WEB-INF中徏立web.xml 文g内容如下Q? <!-- Web.xml -->
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"<web-app><!-- Listeners -->
<listener>
<listener-class>
SessionCount.SessionCounter
</listener-class>
</listener></web-app>试了一下,发出当用戯用SessionCountercLsessionCreatedҎ被执行,activeSessions?Q但是,关闭览?br />sessionDestroyedq没有被执行Qؓ什么呢Q原因是因ؓx览器不一定会释放sessionQ所以,DsessionDestroyed
不会被执行,那么Q有什么方法呢Q退出页面logout.jsp上,使用session.invalidate()释放会话,那么sessionDestroyed
也就被执行,在线人数也就相应的减1Q或是设|session的不zd旉{等?/pre>何以解忧Q唯有学习!让每一个h都能Open Source 2006-04-19 15:55 发表评论]]>
-----------------下以是引用的------------------------------------
Mysql JDBC驱动Qmysql-connector-java-3.0.14-production-bin.jar Q?/p>
注意Q?/strong>Mysql数据库版本和JDBC驱动要选择好版本,不然Ҏ出现中文q?br />
---------------------------------------------------------------------------------------------------------------------------
它没有说清楚用的是什么版本的Q?br />试证明Q用4.1版本的MySQL?.1.8q是会出Cؕ码,主要表面在在JIRA在项目信息或是描qCؓ中文是,查看时会出现qQ这是,我后来改??的,字符集没变,问题解决?br />
接下来就配置conf/server.xml q个文g?q个文g不知道在那?KAOQTOMCAT配置q了吧,不懂的BAIDU一下多得是)
---------------------------以下引用官方的说?------------------
Edit conf/server.xml (or conf/Catalina/localhost/jira.xml if you're not using Standalone), and customize the username, password, driverClassName, and url parameters for the Datasource (here assuming MySQL). Please refer to one of the sections below that applies to your database for more information.
<Server port="8005" shutdown="SHUTDOWN"> <Service name="Catalina"> <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" /> <Engine name="Catalina" defaultHost="localhost"> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="true"> <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource" username="[enter db username]" password="[enter db password]" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/jiradb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8" [ delete the minEvictableIdleTimeMillis and timeBetweenEvictionRunsMillis params here ] /> <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction" factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/> <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/> </Context> </Host> </Engine> </Service> </Server>
Note: if you can't find this section at all, you've probably got the wrong file - search for mentions of 'jira' in the files under conf/, or ask the person who installed JIRA in Tomcat.
-----------------------------------------------------------------------------------------------------------------------
E文不会看Q好Q那我就说一下吧Q其它的不用你理Q你主要注意改一下加_那部䆾usernameZ数据库的用户名,password为密码如果用MySql的,driverClassName不用改了。jiradb为数据库名,如果你没改也不需要改了?br />
好下面我们来配置W二个文?br />
---------------------------以下引用官方的说?------------------
Edit atlassian-jira/WEB-INF/classes/entityengine.xml, and change the field-type-name attribute to the value for your database (valid values are listed in the file). As noted in the comment, other databases/appservers may require other entityengine.xml changes:
<!-- DATASOURCE - You will need to update this tag for your installation. 1. Update field-type-name attribute to match your database. Possible values include: cloudscape, db2, firebird, frontbase, hsql, mckoidb, mysql, mssql, oracle, postgres, postgres72, sapdb, sybase 2. If using Orion, JBoss or Jetty you will need to customize the <jndi-jdbc> tag. See http://www.atlassian.com/software/jira/docs/latest/servers/ 3. If using Postgres 7.3+ (schema-aware), add: schema-name="public" to the datasource attribute list below. If using DB2, add: constraint-name-clip-length="15" to the datasource attribute list below, and an appropriate schema-name attribute, eg: schema-name="DB2INST1" --> <datasource name="defaultDS" field-type-name="mysql" helper-class="org.ofbiz.core.entity.GenericHelperDAO" check-on-start="true" ...
If you forget to do this and start JIRA, it may create database tables incorrectly. See this page if this happens to you
---------------------------------------------------------------------------------------------------------------------------
看到加粗的地Ҏ有,用mysql的,改mysqlQ这是数据库cd啊?br />接下来是最后一了Q运行Mysql命o行,新徏一个名为jiradb的数据库Q(如果刚才没改的话Q?br />
好了Q现在你可以q行了,q行%JIRA_HOME%\bin\startup.bat 接下来,q行http://localhost:8080
看到效果了吧Q现在才是真正的安装呢,q个q程Q它要你输入用户名,密码Q跟一些信息,q要输入licenseQ这个东西你可以在官方主上生成一?0天试用期的,具休怎么获得Q这里我不讲了,我有3.5.3的破解,可以用一q的Q是好友jackrongl的Q要的朋友可以联pL?br /> 好了Q这是我的处女作啊Q介l得不好Q希望大家指点,一起学习,一赯步!