⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 commonmethods.java

📁 JAVA邮件系统
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
	
	static TemplateList Folder_ShowTemplate =TemplateList.
					getTemplate(sTemplateDir+"t_FolderShow.html");
	static public TemplateList getFolder_ShowTemplate(){
		return Folder_ShowTemplate;
	}
	
	
	//Hb templates
	static TemplateList Hbjh_MainTemplate =TemplateList.
					getTemplate(sTemplateDir+"t_HbjhMain.html");
	static public TemplateList getHbjh_MainTemplate(){
		return Hbjh_MainTemplate;
	}
	
	
	static TemplateList Hbdt_MainTemplate =TemplateList.getTemplate 
					(sTemplateDir+"t_HbdtMain.html");
	static public TemplateList getHbdt_MainTemplate(){
		return Hbdt_MainTemplate;
	}
	
	
	static TemplateList Hbtx_MainTemplate =TemplateList.getTemplate 
					(sTemplateDir+"t_HbtxMain.html");
	static public TemplateList getHbtx_MainTemplate(){
		return Hbtx_MainTemplate;
	}
	
	static TemplateList Hbtx_ShowTemplate =TemplateList.getTemplate 
					(sTemplateDir+"t_HbtxShow.html");
	static public TemplateList getHbtx_ShowTemplate(){
		return Hbtx_ShowTemplate;
	}
	
	//HbNew:
	static TemplateList Hb_NewTemplate =TemplateList.getTemplate 
					(sTemplateDir+"t_HBNEW.html");
	static public TemplateList getHb_NewTemplate(){
		return Hb_NewTemplate;
	}
	
	//Han template......
  //管理界面模板
  static TemplateList tempListManage=TemplateList.getTemplate(sTemplateDir+"WebManage.htm");
  static public TemplateList getWebManageTemplate(){
    return tempListManage;
  }
	//编辑定制显示天气的城市的模板
	static TemplateList tempListWeather_Edit=TemplateList.
					getTemplate(sTemplateDir+"t_editWeather.htm");
	static public TemplateList	getWeatherEditTemplate(){
	    return tempListWeather_Edit;
	}
    //显示日历模板
	static TemplateList tempListDate_ShowDay=TemplateList.
					getTemplate(sTemplateDir+"t_DateShowDay.htm");
	static public TemplateList	getDateShowDayTemplate(){
	    return tempListDate_ShowDay;
	}
	//显示月历模板
	//显示周历模板
    //显示日历模板
    //显示重要日子的模板
	//显示年历的模板
	static TemplateList tempListDate_EditImport=TemplateList.
						getTemplate(sTemplateDir+"t_DateEditImport.htm");
	static public TemplateList getDateEditImportTemplate(){
	  return tempListDate_EditImport;
	}

    //显示重要日子的模板
	static TemplateList tempListDate_ShowImport=TemplateList.
				getTemplate (sTemplateDir+"t_DateShowImport.htm");
	static public TemplateList getDateShowImportTemplate(){
		return tempListDate_ShowImport;
	}

	static TemplateList tempListDate_ShowYear=TemplateList.
					getTemplate(sTemplateDir+"t_DateShowYear.htm");
	static public TemplateList	getDateShowYearTemplate(){
	    return tempListDate_ShowYear;
	}
	//写日记的模板
    static TemplateList tempListDate_EditDiary=TemplateList.
					getTemplate(sTemplateDir+"t_DateEditDiary.htm");
	static public TemplateList	getDateEditDiaryTemplate(){
	    return tempListDate_EditDiary;
	}	
  	//编辑工作计划的模板
	static TemplateList tempListDate_EditThing=TemplateList.
					getTemplate(sTemplateDir+"t_DateEditThing.htm");
	static public TemplateList	getDateEditThingTemplate(){
	    return tempListDate_EditThing;
	}

    //单条新闻的显示模板
	static TemplateList tempListNews_SingleShow=TemplateList.
					getTemplate(sTemplateDir+"t_newsSingle.htm") ;
	static public TemplateList getSingleNewsTemplate(){
		return tempListNews_SingleShow;
	}
   //新闻类别分类模板:
	//定制新闻内容模板:
	static TemplateList tempListNews_Edit=TemplateList.
					getTemplate (sTemplateDir+"t_NewsEdit.htm");
	static public TemplateList getNewsEditTemplate(){
		return tempListNews_Edit;
	}
	//要闻类模板
	static TemplateList tempListNews_ImportTitle=TemplateList.getTemplate (sTemplateDir+"t_ImportNews.htm");
	static public TemplateList getImportNewsTemplate(){
		return tempListNews_ImportTitle;
	}
	//新闻类
	static TemplateList tempListNews_NewsTitle=TemplateList.getTemplate (sTemplateDir+"t_NewsTemp.htm");
	static public TemplateList getNewsTemplate(){
		return tempListNews_NewsTitle;
	}
	//金融类
	static TemplateList tempListNews_FinanceTitle=TemplateList.getTemplate (sTemplateDir+"t_FinanceNews.htm");
	static public TemplateList getFinanceNewsTemplate(){
		return tempListNews_FinanceTitle;
	}
	//
	static TemplateList tempListNews_EconomyTitle=TemplateList.getTemplate (sTemplateDir+"t_EconomyNews.htm");
	static public TemplateList getEconomyNewsTemplate(){
		return tempListNews_EconomyTitle;
	}
	//
	static TemplateList tempListNews_SportTitle=TemplateList.getTemplate (sTemplateDir+"t_SportNews.htm");
	static public TemplateList getSportNewsTemplate(){
		return tempListNews_SportTitle;
	}
	//
	static TemplateList tempListNews_LeisureTitle=TemplateList.getTemplate (sTemplateDir+"t_LeisureNews.htm");
	static public TemplateList getLeisureNewsTemplate(){
		return tempListNews_LeisureTitle;
	}
	//
	static TemplateList tempListNews_FilmTitle=TemplateList.getTemplate (sTemplateDir+"t_FilmNews.htm");
	static public TemplateList getFilmNewsTemplate(){
		return tempListNews_FilmTitle;
	}
	//
 	static TemplateList tempListNews_LetterTitle=TemplateList.getTemplate (sTemplateDir+"t_LetterNews.htm");
	static public TemplateList getLetterNewsTemplate(){
		return tempListNews_LetterTitle;
	}
	//
	static TemplateList tempListNews_TabloidTitle=TemplateList.getTemplate (sTemplateDir+"t_TabloidNews.htm");
	static public TemplateList getTabloidNewsTemplate(){
		return tempListNews_TabloidTitle;
	}
	//
	static TemplateList tempListNews_NetTitle=TemplateList.getTemplate (sTemplateDir+"t_NetNews.htm");
	static public TemplateList getNetNewsTemplate(){
		return tempListNews_NetTitle;
	}
	//
	static TemplateList tempListNews_HouseTitle=TemplateList.getTemplate (sTemplateDir+"t_HouseNews.htm");
	static public TemplateList getHouseNewsTemplate(){
		return tempListNews_HouseTitle;
	}
	//
	static TemplateList tempListNews_JobTitle=TemplateList.getTemplate (sTemplateDir+"t_JobNews.htm");
	static public TemplateList getJobNewsTemplate(){
		return tempListNews_JobTitle;
	}
	//
	static TemplateList tempListNews_EducateTitle=TemplateList.getTemplate (sTemplateDir+"t_EducateNews.htm");
	static public TemplateList getEducateNewsTemplate(){
		return tempListNews_EducateTitle;
	}
	//
	static TemplateList tempListNews_ComputerTitle=TemplateList.getTemplate (sTemplateDir+"t_ComputerNews.htm");
	static public TemplateList getComputerNewsTemplate(){
		return tempListNews_ComputerTitle;
	}
	//
	static TemplateList tempListNews_LocalTitle=TemplateList.getTemplate (sTemplateDir+"t_LocalNews.htm");
	static public TemplateList getLocalNewsTemplate(){
		return tempListNews_LocalTitle;
	}
	//
	static TemplateList tempListNews_LiveTitle=TemplateList.getTemplate (sTemplateDir+"t_LiveNews.htm");
	static public TemplateList getLiveNewsTemplate(){
		return tempListNews_LiveTitle;
	}
	//
	static TemplateList tempListNews_ConsumeTitle=TemplateList.getTemplate (sTemplateDir+"t_ConsumeNews.htm");
	static public TemplateList getConsumeNewsTemplate(){
		return tempListNews_ConsumeTitle;
	}
	//新闻标题模板
	static TemplateList tempListNews_ShowTitle=TemplateList.getTemplate 
		(sTemplateDir+"t_ShowNewsTitle.htm");
	static public TemplateList getShowTitleTemplate(){
		return tempListNews_ShowTitle;
	}
	//某一类别的所有新闻的显示
	static TemplateList tempListNews_ShowSingleTitle
		=TemplateList.getTemplate (sTemplateDir+"t_ShowSingleNewsTitle.htm");
	static public TemplateList getShowSingleTitleTemplate(){
		return tempListNews_ShowSingleTitle;
	}

	static TemplateList tempListNewsLL=TemplateList.getTemplate (sTemplateDir+"t_shownewLL.htm");
	static public TemplateList getNewsLLTemplate(){
		return tempListNewsLL;
	}

	static TemplateList tempListNewsLL1=TemplateList.getTemplate (sTemplateDir+"t_shownewLL1.htm");
	static public TemplateList getNewsLLTemplate1(){
		return tempListNewsLL1;
	}
	
	static TemplateList tempListMakeRoot =TemplateList.getTemplate
		(sTemplateDir+"t_makemain.html");
	static public TemplateList getMakeLoginTemplate(){
		return tempListMakeRoot;
	}

	//显示天气预报的模板
	static TemplateList tempListWeather_ShowWeather = TemplateList.getTemplate (sTemplateDir+"t_ShowWeather.htm");
	static public TemplateList getShowWeatherTemplate(){
		return tempListWeather_ShowWeather;
	}
	//显示空气质量模板
	static TemplateList tempListPollute_ShowPollute = TemplateList.getTemplate (sTemplateDir+"t_ShowPollute.htm");
	static public TemplateList getShowPolluteTemplate(){
		return tempListPollute_ShowPollute;
	}
	//显示金融中心模板
	static TemplateList tempListNews_ShowJrzx = TemplateList.getTemplate (sTemplateDir+"t_jrzx.htm");
	static public TemplateList getShowJrzxTemplate(){
		return tempListNews_ShowJrzx;
	}
	//显示金融中心单条新闻的模板
	static TemplateList tempListNews_JrzxTitle = TemplateList.getTemplate (sTemplateDir + "t_ShowJrzxTitle.htm");
	static public TemplateList getJrzxTitleTemplate(){
		return tempListNews_JrzxTitle;
	}

	static TemplateList templateAddNews = TemplateList.getTemplate (sTemplateDir + "t_AddNews.html");
	static public TemplateList getAddNewsTemplate(){
		return templateAddNews;
	}
	
	static TemplateList templateDefault1 = TemplateList.getTemplate (sTemplateDir + "t_Default1.htm");
	static public TemplateList getTemplateDefault1(){
		return templateDefault1;
	}
	static TemplateList templateDefault2 = TemplateList.getTemplate (sTemplateDir + "t_Default2.htm");
	static public TemplateList getTemplateDefault2(){
		return templateDefault2;
	}
	static TemplateList tempChangePassword=TemplateList.
          getTemplate(sTemplateDir+"t_changepassword.htm");
	static public TemplateList getChagePasswordTemplate(){
      return tempChangePassword;
	}
	
	
	/****************************************************************/

	//for the channels ;
	//we should read the channels for only once .
	//you can find channel with FindChannel() methods. .
	public static ChannelList channelList=new ChannelList();
	public static int getChannelNum(){
		return channelList.getChannelNum ();
	}
	static public Channel FindChannel(String channelID){
		return channelList.searchChannel(channelID);
	}	
	
	
	
	//get user name and user password in servlet.
	public static String GetCookie(HttpServletRequest request,String sCookie){
		Cookie[] cookies = request.getCookies();
		String sValue=null;
		
		for (int i = 0; i < cookies.length; i++) {
		    Cookie c = cookies[i];
			if(c==null)
				continue;
			
		    String cname = c.getName();
			if(cname==null)
				continue;
		    if( cname.compareTo (sCookie)==0 )
				sValue= c.getValue();
		}
		return sValue;
		
	}
	public static String GetUserName(HttpServletRequest request){
		
		return GetCookie( request, "username");
		
	}
	public static String GetUserPass(HttpServletRequest request){
		return GetCookie( request, "password");
	}
	
	//record all the dabase connections
	static int m_nDBConnect = 0;
	static public Vector MainDBConnectList = new Vector(100,100);
	
	//database methods ;
	static public Connection getDBConnection(String system)
	{
		Connection con = makeDBConnection(sDataBase,"sa",sDBPass);
		
		
		return con;
	}
	/*
	static public DBConnect getDBConnection(String system)
	{
		DBConnect con;
		//switch system first ...
		
		//get the main database connection
		if(MainDBConnectList==null){
			MainDBConnectList = new Vector(100,100);
		}
		Vector DBList = MainDBConnectList;
		con = FindDBConnect(DBList);
		if(con == null ){ 
			Connection c = makeDBConnection(sDataBase,"sa","");
			if(c!=null){
				con = new DBConnect(c);
				MainDBConnectList.addElement (con);
			}
		}
		return con;	
	}
	*/
	/*
	static DBConnect FindDBConnect(Vector DBList)
	{
		int size = DBList.size ();
		DBConnect dbCon;
		for( int i=0;i<size;i++ ){
			dbCon = (DBConnect)DBList.elementAt (i);
			if( dbCon.CanUse () ){
				dbCon.SetUsing();
				return dbCon;
			}
		}
		return null;
	}
	*/
	static Connection makeDBConnection(String sDB,String sUser,String sPass)
	{
		m_nDBConnect++;
		Connection con=null;

		if( nUseDB==0 ){
			java.util.Properties props = new java.util.Properties();
			if( nUseGBTypeInDB==1)
				props.put("weblogic.codeset", "GB2312");
			props.put("db",          sDB);
			props.put("server",       sDBHost);
			props.put("user", sUser);
			props.put("password", sPass);
			String connectUrl = "jdbc:weblogic:mssqlserver4";
			try{
				Driver myDriver = (Driver)Class.forName("weblogic.jdbc.mssqlserver4.Driver").newInstance();
				con = myDriver.connect(connectUrl, props);
			}catch(Exception e){
				System.out.println (e.toString ());
			}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -