javafan

2013年8月24日 #

关于Tomcat的部署信息整理,包括编码乱码问题

1.装新版本的jdk

 

2.装一个eclipse最基础版本

 

3.安装apache官网的tomcat,我用的是安装版

 

4.下载eclipse中的tomcat插件,目前的地址是:http://www.eclipsetotale.com/tomcatPlugin.html

    然后将插件内容copy到eclipse的plugins目录下,重启eclipse

 

5.如果没有出现小猫图标,则那么选择'Window>Customize Perspective...>Commands',并在'Available command groups'中勾选'Tomcat'

 

6.在Preferences中配置Tomcat,主要配置Version和Home

 

7.尝试跑一下,如果不行,看看 首选项 中Java里的 已安装的JRE是否使用的跟Tomcat中配置的一致

    如果还不行,再检查一下Java编译器中的JDK版本

 

8.在tomcat中的server.xml中,设置一下URIEncoding

         <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"/>

posted @ 2013-08-24 12:07 明天的明天 阅读(2029) | 评论 (2)编辑 收藏

hibernate二级缓存

第一步:添加二级缓存配置文件ehcache.xml到项目的src目录

    ehcache.xml文件可以在hibernate-release-4.2.4.Final\project\etc目录下找到

 

第二步:配置hibernate.cfg.xml文件

1、首先添加二级缓存支持:

<property name="cache.use_second_level_cache">true</property>

 

2、添加二级缓存服务提供类:

<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>

 

3、添加需要用到二级缓存的类

<class-cache usage="read-only" class="com.study.bean.Student"/>

 

第三步:添加commons-logging-1.1.3.jar,不然会报错下载地址:http://apache.dataguru.cn//commons/logging/binaries/commons-logging-1.1.3-bin.zip

 

 

posted @ 2013-08-24 12:06 明天的明天 阅读(1373) | 评论 (0)编辑 收藏

qq2013 java版(毕业设计源码 包含服务端 oracle数据库)

Java代码  收藏代码
  1. /** 
  2.  * 初始化组件 
  3.  */  
  4. private void initComponent() {  
  5.     //提示面板  
  6.     errorTipPane = new ErrorTipPane();  
  7.     // 主面板  
  8.     mainPane = new MainPane();  
  9.     // 底部登录按钮面板  
  10.     downPane = new DownPane();  
  11.        
  12.     // 登陆头像及背景  
  13.     lblLoginHeadimg = new JLabel(new ImageIcon("image/Login/qqhead.png"));  
  14.     lblLoginHeadbkg = new JLabel(new ImageIcon(  
  15.             "image/Login/login_head_white.png"));  
  16.     // 用户名文本框  
  17.     jtfAccount = new JTextField("100000");  
  18.     jtfAccount.setBorder(new LineBorder(Color.GRAY, 1));  
  19.     jtfAccount.setFont(new Font("Verdana", Font.PLAIN, 12));  
  20.     jtfAccount.setForeground(Color.black);  
  21.   
  22.     // 密码输入框  
  23.     pwdfPassword = new JPasswordField("1234567890  ");  
  24.     pwdfPassword = new JPasswordField("123");  
  25.     pwdfPassword.requestFocus(true);  
  26.     pwdfPassword.setBorder(new LineBorder(Color.GRAY, 1));  
  27.     pwdfPassword.setFont(font);  
  28.     pwdfPassword.setForeground(Color.black);  
  29.     pwdfPassword.setEchoChar('●');  
  30.   
  31.     // 自动登陆复选框  
  32.     chkAutoLogin = JButtonUtil.getIconCheckBox(  
  33.             "image/Login/checkbox_normal.png",  
  34.             "image/Login/checkbox_hover.png",  
  35.             "image/Login/checkbox_press.png",  
  36.             "image/Login/checkbox_selected_hover.png");  
  37.     // 记住密码复选框  
  38.     chkRememberPwd = JButtonUtil.getIconCheckBox(  
  39.             "image/Login/checkbox_normal.png",  
  40.             "image/Login/checkbox_hover.png",  
  41.             "image/Login/checkbox_press.png",  
  42.             "image/Login/checkbox_selected_hover.png");  
  43.     // 自动登陆标签  
  44.     lblAutoLogin = new JLabel("自动登录");  
  45.     lblAutoLogin.setFont(font);  
  46.     lblAutoLogin.setForeground(Color.black);  
  47.     // 记住密码标签  
  48.     lblRememberPwd = new JLabel("记住密码");  
  49.     lblRememberPwd.setFont(font);  
  50.     lblRememberPwd.setForeground(Color.black);  
  51.   
  52.     this.initStatus();  
  53.     this.initButton();  
  54.     this.initPupupMenu();  
  55.        
  56.     jtfAccount.addMouseListener(new MouseAdapter() {  
  57.         @Override  
  58.         public void mouseClicked(MouseEvent e) {  
  59.             if(e.getClickCount()==1||e.getClickCount()==2){  
  60.                 mainPane.remove(errorTipPane);  
  61.                 mainPane.add(downPane);  
  62.                 downPane.setBounds(024138051);  
  63.                 mainPane.updateUI();  
  64.                 mainPane.validate();  
  65.             }  
  66.         }  
  67.     });  
  68.        
  69.     pwdfPassword.addMouseListener(new MouseAdapter() {  
  70.         @Override  
  71.         public void mouseClicked(MouseEvent e) {  
  72.             if(e.getClickCount()==1||e.getClickCount()==2){  
  73.                 mainPane.remove(errorTipPane);  
  74.                 mainPane.add(downPane);  
  75.                 downPane.setBounds(024138051);  
  76.                 mainPane.updateUI();  
  77.                 mainPane.validate();  
  78.             }  
  79.         }  
  80.     });  
  81. }  

 

下载地址:http://yuncode.net/code/c_5204f5d84703a42

posted @ 2013-08-24 12:05 明天的明天 阅读(1917) | 评论 (1)编辑 收藏