锘??xml version="1.0" encoding="utf-8" standalone="yes"?>女人av一区,亚洲www在线,日本一区二区精品视频http://www.aygfsteel.com/yooli88/zh-cnThu, 19 Jun 2025 07:24:33 GMTThu, 19 Jun 2025 07:24:33 GMT60java 瀛楃涓茶В鏋? 杞嚦csdn鐨刟fgasdg http://www.aygfsteel.com/yooli88/archive/2011/04/06/347729.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Wed, 06 Apr 2011 10:54:00 GMThttp://www.aygfsteel.com/yooli88/archive/2011/04/06/347729.htmlhttp://www.aygfsteel.com/yooli88/comments/347729.htmlhttp://www.aygfsteel.com/yooli88/archive/2011/04/06/347729.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/347729.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/347729.html= new StringTokenizer(number, ",");
       
boolean bool = true;
       
while (tokenizer.hasMoreTokens()) {
           
try {
                Double.valueOf(tokenizer.nextToken());
            }
catch (Exception e) {
                bool
= false;
            }
        }
//灝嗗瓧絎︿覆杞寲涓烘暟緇勭殑鏂規硶
int gv[];
  
int i = 0;
   StringTokenizer tokenizer
= new StringTokenizer(goodsVolume, "錛? ");
         gv
= new int[tokenizer.countTokens()];//鍔ㄦ佺殑鍐沖畾鏁扮粍鐨勯暱搴?/span>
     while (tokenizer.hasMoreTokens()) {
        String d
= tokenizer.nextToken();
        gv[i]
= Integer.valueOf(d);//灝嗗瓧絎︿覆杞崲涓烘暣鍨?/span>
        i++;
    }

//瀛楃涓茶В鏋?/span>
    private String[] stringAnalytical(String str, String divisionChar) {
        String string[];
      
int i = 0;
        StringTokenizer tokenizer
= new StringTokenizer(str, divisionChar);
        string
= new String[tokenizer.countTokens()];// 鍔ㄦ佺殑鍐沖畾鏁扮粍鐨勯暱搴?/span>
         while (tokenizer.hasMoreTokens()) {
            string[i]
= new String();
            string[i]
= tokenizer.nextToken();
            i
++;
        }
       
return string;// 榪斿洖瀛楃涓叉暟緇?/span>
    }

int countTokens()
          璁$畻鍦ㄧ敓鎴愬紓甯鎬箣鍓嶅彲浠ヨ皟鐢ㄦ tokenizer 鐨?nextToken 鏂規硶鐨勬鏁般?
boolean hasMoreElements()
          榪斿洖涓?hasMoreTokens 鏂規硶鐩稿悓鐨勫箋?
boolean hasMoreTokens()
          嫻嬭瘯姝?tokenizer 鐨勫瓧絎︿覆涓槸鍚﹁繕鏈夋洿澶氱殑鍙敤鏍囪銆?
Object nextElement()
          闄や簡鍏跺0鏄庤繑鍥炲兼槸 Object 鑰屼笉鏄?String 涔嬪錛屽畠榪斿洖涓?nextToken 鏂規硶鐩稿悓鐨勫箋?
String nextToken()
          榪斿洖姝?string tokenizer 鐨勪笅涓涓爣璁般?
String nextToken(String delim)
          榪斿洖姝?string tokenizer 鐨勫瓧絎︿覆涓殑涓嬩竴涓爣璁般?




public class StringAnalytical {

   
// 瀛楃涓茶В鏋愶紝灝嗗瓧絎︿覆杞牴鎹垎鍓茬鎹㈡垚瀛楃涓叉暟緇?/span>
    private String[] stringAnalytical(String string, char c) {
       
int i = 0;
       
int count = 0;

       
if (string.indexOf(c) == -1)
           
return new String[] { string };// 濡傛灉涓嶅惈鍒嗗壊絎﹀垯榪斿洖瀛楃鏈韓
        char[] cs = string.toCharArray();
       
int length = cs.length;
       
for (i = 1; i < length - 1; i++) {// 榪囨護鎺夌涓涓拰鏈鍚庝竴涓槸鍒嗛殧絎︾殑鎯呭喌
            if (cs[i] == c) {
                count
++;// 寰楀埌鍒嗛殧絎︾殑涓暟
            }
        }
        String[] strArray
= new String[count + 1];
       
int k = 0, j = 0;
        String str
= string;
       
if ((k = str.indexOf(c)) == 0)// 鍘繪帀絎竴涓瓧絎︽槸鍒嗛殧絎︾殑鎯呭喌
            str = str.substring(k + 1);
       
if (str.indexOf(c) == -1)// 媯嫻嬫槸鍚﹀惈鍒嗛殧絎︼紝濡傛灉涓嶅惈鍒欒繑鍥炲瓧絎︿覆
            return new String[] { str };
       
while ((k = str.indexOf(c)) != -1) {// 瀛楃涓插惈鍒嗗壊絎︾殑鏃跺?/span>
            strArray[j++] = str.substring(0, k);
            str
= str.substring(k + 1);
           
if ((k = str.indexOf(c)) == -1 && str.length() > 0)
                strArray[j
++] = str.substring(0);
        }
       
return strArray;
    }

   
public void printString(String[] s) {
        System.out.println(
"*********************************");
       
for (String str : s)
            System.out.println(str);
    }

   
public static void main(String[] args) {
        String[] str
= null;
        StringAnalytical string
= new StringAnalytical();
        str
= string.stringAnalytical("1aaa", '@');
        string.printString(str);
        str
= string.stringAnalytical("2aaa@", '@');
        string.printString(str);
        str
= string.stringAnalytical("@3aaa", '@');
        string.printString(str);
        str
= string.stringAnalytical("4aaa@bbb", '@');
        string.printString(str);
        str
= string.stringAnalytical("@5aaa@bbb", '@');
        string.printString(str);
        str
= string.stringAnalytical("6aaa@bbb@", '@');
        string.printString(str);
        str
= string.stringAnalytical("@7aaa@", '@');
        string.printString(str);
        str
= string.stringAnalytical("@8aaa@bbb@", '@');
        string.printString(str);
        str
= string.stringAnalytical("@9aaa@bbb@ccc", '@');
        string.printString(str);
        str
= string.stringAnalytical("@10aaa@bbb@ccc@eee", '@');
        string.printString(str);
    }
}


]]>
java鏃ユ湡澶勭悊bean 杞嚦csdn鐨刟fgasdghttp://www.aygfsteel.com/yooli88/archive/2011/04/06/347726.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Wed, 06 Apr 2011 10:52:00 GMThttp://www.aygfsteel.com/yooli88/archive/2011/04/06/347726.htmlhttp://www.aygfsteel.com/yooli88/comments/347726.htmlhttp://www.aygfsteel.com/yooli88/archive/2011/04/06/347726.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/347726.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/347726.html闃呰鍏ㄦ枃

]]>
浠?csdn鐪嬪埌鐨勪竴浜涘緢鏈夌敤鐨勪唬鐮? 鐏板父鎰熻阿afgasdg浜? 杞笘璇鋒敞鏄巃fgasdghttp://www.aygfsteel.com/yooli88/archive/2011/04/06/347725.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Wed, 06 Apr 2011 10:49:00 GMThttp://www.aygfsteel.com/yooli88/archive/2011/04/06/347725.htmlhttp://www.aygfsteel.com/yooli88/comments/347725.htmlhttp://www.aygfsteel.com/yooli88/archive/2011/04/06/347725.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/347725.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/347725.htmljava璁塊棶xml鏂囦歡
Java code

import java.io.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class xmljava
{

public static void main(String args[])
    {   
          Element element
=null;
          File f
=new File("a.xml");
          DocumentBuilder db
=null;        //documentBuilder涓烘娊璞′笉鑳界洿鎺ュ疄渚嬪寲(灝哫ML鏂囦歡杞崲涓篋OM鏂囦歡)
          DocumentBuilderFactory dbf=null;
     
try{
        
          dbf
= DocumentBuilderFactory.newInstance(); //榪斿洖documentBuilderFactory瀵硅薄  
          db =dbf.newDocumentBuilder();//榪斿洖db瀵硅薄鐢╠ocumentBuilderFatory瀵硅薄鑾峰緱榪斿洖documentBuildr瀵硅薄

          Document dt
= db.parse(f); //寰楀埌涓涓狣OM騫惰繑鍥炵粰document瀵硅薄
          element = dt.getDocumentElement();//寰楀埌涓涓猠lment鏍瑰厓绱?/span>
         
          System.out.println(
"鏍瑰厓绱狅細"+element.getNodeName()); //鑾峰緱鏍硅妭鐐?/span>

        NodeList childNodes
=element.getChildNodes() ;    // 鑾峰緱鏍瑰厓绱犱笅鐨勫瓙鑺傜偣
   
     
for (int i = 0; i < childNodes.getLength(); i++)     // 閬嶅巻榪欎簺瀛愯妭鐐?/span>

   {      
       Node node1
= childNodes.item(i); // childNodes.item(i); 鑾峰緱姣忎釜瀵瑰簲浣嶇疆i鐨勭粨鐐?/span>

    
if ("Account".equals(node1.getNodeName()))
      {
                       
// 濡傛灉鑺傜偣鐨勫悕縐頒負"Account"錛屽垯杈撳嚭Account鍏冪礌灞炴ype
      System.out.println("\r\n鎵懼埌涓綃囪處鍙? 鎵灞炲尯鍩? "   + node1.getAttributes().getNamedItem        ("type").getNodeValue() + ". ");
      NodeList nodeDetail
= node1.getChildNodes();   // 鑾峰緱<Accounts>涓嬬殑鑺傜偣
      for (int j = 0; j < nodeDetail.getLength(); j++)
       {  
// 閬嶅巻<Accounts>涓嬬殑鑺傜偣
          Node detail = nodeDetail.item(j);    // 鑾峰緱<Accounts>鍏冪礌姣忎竴涓妭鐐?/span>
            if ("code".equals(detail.getNodeName()))   // 杈撳嚭code
            System.out.println("鍗″彿: " + detail.getTextContent());
            
else if ("pass".equals(detail.getNodeName())) // 杈撳嚭pass
                System.out.println("瀵嗙爜: " + detail.getTextContent());
            
else if ("name".equals(detail.getNodeName())) // 杈撳嚭name
                System.out.println("濮撳悕: " + detail.getTextContent());
            
else if ("money".equals(detail.getNodeName())) // 杈撳嚭money
                 System.out.println("浣欓: "+ detail.getTextContent());
     
        }
      }

    }
}

catch(Exception e){System.out.println(e);}
   
}
}


XML code
<?xml version="1.0" encoding="gbk"?> <Accounts> <Account type="by0003"> <code>100001</code> <pass>123</pass> <name>鏉庡洓</name> <money>1000000.00</money> </Account> <Account type="hz0001"> <code>100002</code> <pass>123</pass> <name>寮犱笁</name> <money>1000.00</money> </Account> </Accounts>



]]>
[杞笘]鍦ㄦ暟緇勯噷闅忔満鍙栦笉閲嶅鐨勬暟http://www.aygfsteel.com/yooli88/archive/2011/01/31/343137.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Mon, 31 Jan 2011 08:57:00 GMThttp://www.aygfsteel.com/yooli88/archive/2011/01/31/343137.htmlhttp://www.aygfsteel.com/yooli88/comments/343137.htmlhttp://www.aygfsteel.com/yooli88/archive/2011/01/31/343137.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/343137.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/343137.html
鏂規硶娌℃湁紜
import java.util.*;
public class Lottery {

    public static void main(String[] args) {
        int[] data1 = {3, 5, 6, 8, 9, 15, 18, 24, 27, 30, 32};
        Random r = new Random();
        int irdm = 0;
        for(int i = 0; i < 7; i ++) {
            irdm = r.nextInt(11 - i);
            System.out.println(data1[irdm]);
            for(int j = irdm; j < 11 - i - 1; j ++) {
                data1[j] = data1[j + 1];
            }
        }
    }
}
鏂規硶娌℃湁紜涓嶇煡閬撴槸鍚﹀彲琛宲ublic class AAAAA {
        public static void main(String[] args) {

                int i = 0;
                int j = 0;
                int[] temp = new int[20];
                for (j = 0; j < temp.length; j++) {
                        temp[j] = Math.random() * 100  + 1;
                        System.out.print(temp[j] + ",";
                }
                
                HashSet hh = new HashSet();
                while (hh.size() < 7) {
                        int aa = (int) (Math.random() * 100 + 1);
                        hh.add(aa);
                }
                System.out.println(hh.size());
                Iterator ii = hh.iterator();
                while (ii.hasNext()) {
                        System.out.print(ii.next() + ",";
                }
        }

}

java浠庢寚瀹氭暟緇勪腑鍙栦笉閲嶅鐨?涓殢鏈烘暟

濡備綍鐢╦ava浠庢寚瀹氭暟緇勪腑鍙栦笉閲嶅鐨?涓殢鏈烘暟錛屼互涓嬫槸鎴戝啓鐨勪唬鐮侊紝浣嗘槸鏄湁閲嶅鐨勶紝鍝綅澶т緺璧愭暀涓涓嬪浣曚嬌鐢≧andom綾葷殑縐嶅瓙錛屽府鎴戝疄鐜頒笉閲嶅鐨勯殢鏈烘暟銆傘傘?br /> import java.util.*;
public class Lottery {

    public static void main(String[] args)
    {
        int[] data1 = {3,5,6,8,9,15,18,24,27,30,32};
        Random   r=new   Random();
        StringBuffer   str1=new   StringBuffer();
        for(int   i=0;i<6;i++)
        {
        str1.append(data1[r.nextInt(11)]);
         }
         System.out.println(str1);
   }
}


]]>
瀛楃鎺掑簭 寰堝ソ鐢ㄧ殑浠g爜http://www.aygfsteel.com/yooli88/archive/2008/04/24/195500.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Thu, 24 Apr 2008 04:20:00 GMThttp://www.aygfsteel.com/yooli88/archive/2008/04/24/195500.htmlhttp://www.aygfsteel.com/yooli88/comments/195500.htmlhttp://www.aygfsteel.com/yooli88/archive/2008/04/24/195500.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/195500.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/195500.html char []a={'v','f',',','e','f'};
        Arrays.sort(a);
       
for(char b:a)
        {
            System.out.println(b);
        }



]]>
MVNForumGlobal http://www.aygfsteel.com/yooli88/archive/2007/09/11/144207.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Tue, 11 Sep 2007 03:33:00 GMThttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144207.htmlhttp://www.aygfsteel.com/yooli88/comments/144207.htmlhttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144207.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/144207.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/144207.html/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/MVNForumGlobal.java,v 1.17 2005/01/18 11:52:08 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.17 $
 * $Date: 2005/01/18 11:52:08 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2005 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 * @author: Mai  Nguyen  mai.nh@MyVietnam.net
 */
package com.mvnforum;

public class MVNForumGlobal {

    private MVNForumGlobal() {
    }

/*************************************************************************
 * NOTE: below constants can be changed for each build,
 *       these constant MUST NOT break the compatibility
 *************************************************************************/
    public final static String IMAGE_DIR                 = "/mvnplugin/mvnforum/images";

    public final static String EMOTION_DIR               = "/mvnplugin/mvnforum/images/emotion/";

    public final static String CSS_FULLPATH              = "/mvnplugin/mvnforum/css/style.css";

    public final static String LOGO_FULLPATH             = "/mvnplugin/mvnforum/images/logo.gif";

    // Note that we cannot put / at the end because getRealPath will remove it in Tomcat 4.1.7 :((
    public final static String UPLOADED_AVATAR_DIR       = "/mvnplugin/mvnforum/upload/memberavatars";

    public final static String UPLOADED_COMPANY_DIR      = "/mvnplugin/mvnforum/upload/company";

    public final static String COMPANY_DEFAULT_CSS_PATH  = "/mvnplugin/mvnforum/upload/company/style.css";

    public final static String COMPANY_DEFAULT_LOGO_PATH = "/mvnplugin/mvnforum/upload/company/logo.gif";

    public final static String RESOURCE_BUNDLE_NAME      = "mvnForum_i18n";

    /** value to control the flood prevention. Note value from 0 to 999 is belong to mvnCore */
    public final static Integer FLOOD_ID_NEW_POST       = new Integer(1000);
    public final static Integer FLOOD_ID_NEW_MEMBER     = new Integer(1001);
    public final static Integer FLOOD_ID_LOGIN          = new Integer(1002);
    public final static Integer FLOOD_ID_NEW_MESSAGE    = new Integer(1003);

    /** The maximum length of the email in database */
    public final static int MAX_MEMBER_EMAIL_LENGTH = 60;

    /** The maximum length of the member login name in database */
    public final static int MAX_MEMBER_LOGIN_LENGTH = 30;

    public final static String TEMPLATE_SENDACTIVATECODE_PREFIX  = "sendactivemailtemplate";
    public final static String TEMPLATE_SENDACTIVATECODE_SUBJECT = "sendactivemailtemplate-subject.ftl";
    public final static String TEMPLATE_SENDACTIVATECODE_BODY    = "sendactivemailtemplate-body.ftl";

    public final static String TEMPLATE_FORGOTPASSWORD_PREFIX    = "forgotpasswordtemplate";
    public final static String TEMPLATE_FORGOTPASSWORD_SUBJECT   = "forgotpasswordtemplate-subject.ftl";
    public final static String TEMPLATE_FORGOTPASSWORD_BODY      = "forgotpasswordtemplate-body.ftl";

    public final static String TEMPLATE_WATCHMAIL_PREFIX         = "watchmailtemplate";
    public final static String TEMPLATE_WATCHMAIL_SUBJECT        = "watchmailtemplate-subject.ftl";
    public final static String TEMPLATE_WATCHMAIL_BODY           = "watchmailtemplate-body.ftl";

    // Constant for Company module
    public final static String COMPANY_GROUP_FREFIX              = "CompanyGroup: ";
}



]]>
MVNForumFactoryConfig http://www.aygfsteel.com/yooli88/archive/2007/09/11/144206.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Tue, 11 Sep 2007 03:32:00 GMThttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144206.htmlhttp://www.aygfsteel.com/yooli88/comments/144206.htmlhttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144206.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/144206.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/144206.html/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/MVNForumFactoryConfig.java,v 1.12 2005/01/18 11:52:08 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.12 $
 * $Date: 2005/01/18 11:52:08 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2005 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Luis Miguel Hernanz <luish@germinus.com>
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 */
package com.mvnforum;

import java.io.File;

import net.myvietnam.mvncore.configuration.DOM4JConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.myvietnam.mvncore.util.FileUtil;

/**
 * Class that loads and makes accesible the factory configuration.
 *
 * @author <a href="luish@germinus.com">Luis Miguel Hernanz</a>
 * @version $Revision: 1.12 $
 */
public class MVNForumFactoryConfig {

    private static Log log = LogFactory.getLog(MVNForumFactoryConfig.class);

    private static final String OPTION_FILE_NAME     = "mvnforum.xml";

    private static String authenticatorClassName     = null;
    private static String memberManagerClassName     = "com.mvnforum.db.jdbc.MemberDAOImplJDBC";
    private static String onlineUserFactoryClassName = "com.mvnforum.auth.OnlineUserFactoryImpl";
    private static String requestProcessorClassName  = "com.mvnforum.RequestProcessorDefault";
    private static String luceneAnalyzerClassName    = "org.apache.lucene.analysis.standard.StandardAnalyzer";

    public static String getMemberManagerClassName() {
        return memberManagerClassName;
    }

    public static String getOnlineUserFactoryClassName() {
        return onlineUserFactoryClassName;
    }

    public static String getAuthenticatorClassName() {
        return authenticatorClassName;
    }

    public static String getRequestProcessorClassName() {
        return requestProcessorClassName;
    }

    public static String getLuceneAnalyzerClassName() {
        return luceneAnalyzerClassName;
    }

    static {
        try {
            String strPathName      = FileUtil.getServletClassesPath();
            String configFilename   = strPathName + OPTION_FILE_NAME;
            DOM4JConfiguration conf = new DOM4JConfiguration(new File(configFilename));

            memberManagerClassName     = conf.getString("mvnforumfactoryconfig.member_implementation", memberManagerClassName);
            onlineUserFactoryClassName = conf.getString("mvnforumfactoryconfig.onlineuser_implementation", onlineUserFactoryClassName);
            authenticatorClassName     = conf.getString("mvnforumfactoryconfig.authenticator_implementation", authenticatorClassName);
            requestProcessorClassName  = conf.getString("mvnforumfactoryconfig.requestprocessor_implementation", requestProcessorClassName);
            luceneAnalyzerClassName    = conf.getString("mvnforumfactoryconfig.lucene_analyzer_implementation", luceneAnalyzerClassName);
        } catch (Exception e) {
            log.error("Error loading the factory properties", e);
        }
    }
}



]]>
MVNForumContextListener http://www.aygfsteel.com/yooli88/archive/2007/09/11/144204.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Tue, 11 Sep 2007 03:32:00 GMThttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144204.htmlhttp://www.aygfsteel.com/yooli88/comments/144204.htmlhttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144204.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/144204.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/144204.html/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/MVNForumContextListener.java,v 1.6 2005/01/18 11:52:08 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.6 $
 * $Date: 2005/01/18 11:52:08 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2005 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 * @author: Mai  Nguyen  mai.nh@MyVietnam.net
 */
package com.mvnforum;

import java.sql.Timestamp;

import javax.servlet.*;

import net.myvietnam.mvncore.util.DateUtil;
import net.myvietnam.mvncore.util.FileUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class MVNForumContextListener implements ServletContextListener {

    private static Log log = LogFactory.getLog(MVNForumContextListener.class);

    private static MVNForumContextListener instance;

    private Timestamp startTimestamp;

    /**
     * The servlet context with which we are associated.
     */
    private ServletContext context = null;

    public MVNForumContextListener() {
        instance = this;
    }


    /**
     * Notification that the web application is ready to process requests.
     *
     * @param event ServletContextEvent
     */
    public void contextInitialized(ServletContextEvent event) {
        log.debug("contextInitialized");

        this.context = event.getServletContext();

        String realPath = context.getRealPath("/WEB-INF/classes");// Add '/' before WEB-INF to fix the Oracle 10G bug
        FileUtil.setServletClassesPath(realPath);
        startTimestamp = DateUtil.getCurrentGMTTimestamp();
    }


    /**
     * Notification that the servlet context is about to be shut down.
     *
     * @param event ServletContextEvent
     */
    public void contextDestroyed(ServletContextEvent event) {
        log.debug("contextDestroyed");

        this.context = null;
        instance = null;
    }

    // below are add on method

    public static MVNForumContextListener getInstance() {
        return instance;
    }

    public Timestamp getStartTimestamp() {
        return startTimestamp;
    }

}



]]>
MVNForumConstant http://www.aygfsteel.com/yooli88/archive/2007/09/11/144202.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Tue, 11 Sep 2007 03:31:00 GMThttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144202.htmlhttp://www.aygfsteel.com/yooli88/comments/144202.htmlhttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144202.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/144202.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/144202.html/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/MVNForumConstant.java,v 1.8 2005/01/18 11:52:08 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.8 $
 * $Date: 2005/01/18 11:52:08 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2005 by MyVietnam.net
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * All copyright notices regarding mvnForum MUST remain intact
 * in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in the
 * footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info@MyVietnam.net
 *
 * @author: Minh Nguyen  minhnn@MyVietnam.net
 * @author: Mai  Nguyen  mai.nh@MyVietnam.net
 * @author: Igor Manic   imanic@users.sourceforge.net
 */
package com.mvnforum;

public final class MVNForumConstant {

    /** Cannot instantiate. */
    private MVNForumConstant() {
    }

/*************************************************************************
 * NOTE: below constants MUST NOT be changed IN ALL CASES,
 *       or it will break the compatibility
 *************************************************************************/

    /** Guest/anonymous site visitor. */
    public static final int MEMBER_ID_OF_GUEST             = 0;
    /** System administrator. */
    public static final int MEMBER_ID_OF_ADMIN             = 1;
    /**
     * The highest reserved MemberID.
     * All IDs from 0 through this value should not be used for "regular" members.
     */
    public static final int LAST_RESERVED_MEMBER_ID        = 1;
    /* IMPORTANT: When we have a group without group owner, GroupOwnerID is set to 0.
     * Similiar is for other IDs in the database - 0 means there is no reference.
     * Also, the other reason why MemberID=0 should not be used for Guest is
     * that DBMS could refuse to insert a record with 0 in that field, since it's
     * marked as non-null autoincrement primary key.
     */

    /** Unused GroupID. */
    public static final int GROUP_ID_UNUSED0               = 0;
    /**
     * Unused GroupID. In the previous versions of mvnForum it was used for some
     * special purposes, but should not be used anymore.
     */
    public static final int GROUP_ID_OF_GUEST              = 1;
    /** "Registered Members" virtual group. All members are listed in this group. */
    public static final int GROUP_ID_OF_REGISTERED_MEMBERS = 2;
    /**
     * The highest reserved GroupID.
     * All IDs from 0 through this value should not be used for "regular" groups.
     */
    public static final int LAST_RESERVED_GROUP_ID         = 2;

    /** "Inbox" message folder created by default for each member. */
    public static final String MESSAGE_FOLDER_INBOX        = "Inbox";
    /** "Sent" message folder created by default for each member. */
    public static final String MESSAGE_FOLDER_SENT         = "Sent";
    /** "Draft" message folder created by default for each member. */
    public static final String MESSAGE_FOLDER_DRAFT        = "Draft";
    /** "Trash" message folder created by default for each member. */
    public static final String MESSAGE_FOLDER_TRASH        = "Trash";

    public static final String dtdschemaDecl="<!DOCTYPE mvnforum SYSTEM \"http://www.mvnforum.com/dtd/mvnforum_1_0_rc2.dtd\">";

    public static final String VN_TYPER_MODE = "mvnforum.vntypermode";
}



]]>
MVNForumConfig http://www.aygfsteel.com/yooli88/archive/2007/09/11/144201.html榪瘋尗鍦╦ava鐨勪笘鐣岄噷榪瘋尗鍦╦ava鐨勪笘鐣岄噷Tue, 11 Sep 2007 03:31:00 GMThttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144201.htmlhttp://www.aygfsteel.com/yooli88/comments/144201.htmlhttp://www.aygfsteel.com/yooli88/archive/2007/09/11/144201.html#Feedback0http://www.aygfsteel.com/yooli88/comments/commentRss/144201.htmlhttp://www.aygfsteel.com/yooli88/services/trackbacks/144201.html闃呰鍏ㄦ枃

]]>
主站蜘蛛池模板: 遂川县| 筠连县| 盐源县| 台东县| 宁波市| 米林县| 宁安市| 时尚| 上林县| 河曲县| 来宾市| 阿荣旗| 三明市| 江安县| 滦平县| 松阳县| 大田县| 武穴市| 桂平市| 眉山市| 揭东县| 东兴市| 靖西县| 青田县| 常山县| 泊头市| 台北市| 徐汇区| 论坛| 华蓥市| 焦作市| 依安县| 永德县| 民县| 定兴县| 普定县| 恭城| 乡城县| 乡宁县| 获嘉县| 垫江县|