hyljava

          2014年2月22日 #

          解決SoapUI的Request URL不支持大寫

          在SoapUI的Request URL中,每次輸入的URL中含有的大寫字母會自動轉換為小寫字母,導致請求不了
          這個問題在SoapUI 5.1.2和5.2.1版本中都存在,具體的解決辦法是在HTTP TestRequest Properties的屬性中,在Endpoint中輸入對應的含有大寫字母的URL即可。



          posted @ 2017-03-23 10:27 何云隆 閱讀(401) | 評論 (0)編輯 收藏

          java發送郵件

          Java使用網易郵箱服務器發送郵件實例

          1 下載發送mail需要的jar

           

          activation.jar  與  mail.jar

           

          2 創建 SendMail  

          3 代碼如下

           

           

          import java.util.Date;

          import java.util.Properties;

          import javax.mail.Address;

          import javax.mail.Message;

          import javax.mail.Session;

          import javax.mail.Transport;

          import javax.mail.internet.InternetAddress;

          import javax.mail.internet.MimeMessage;

          import cn.founder.common.globals.Constants;

           

          public class SendMail {

          public int send(String tfrom, String tto, String ttitle, String tcontent) {

          Properties props = new Properties();

          props.put("mail.smtp.host", "smtp.263.net");//自己到網上查找網易發郵件的smtp服務地址 你的發件郵箱如果是163  你就查找163的發件服務器

          props.put("mail.smtp.auth", "true");

          Session s = Session.getInstance(props, null);

          s.setDebug(true);

          Message message = new MimeMessage(s);

          try {

          Address from = new InternetAddress(tfrom);

          message.setFrom(from);

          Address to = new InternetAddress(tto);

          message.setRecipient(Message.RecipientType.TO, to);

          sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder();  

          message.setSubject("=?utf-8?B?"+enc.encode(ttitle.getBytes("utf-8"))+"?=");

          message.setContent(tcontent, "text/html;charset=utf-8");

          message.setSentDate(new Date());

          message.saveChanges();

          Transport transport = s.getTransport("smtp");

          //第一個參數是發件服務器   第二個是你發件的郵箱名  第三個是你發件郵箱的密碼

          transport.connect("smtp.263.net",發件郵箱,發件郵箱密碼);

          transport.sendMessage(message, message.getAllRecipients());

          transport.close();

          return 0;

          } catch (Exception e) {

          e.printStackTrace();

          return 1;

          }

          }

          /**

           * getEmailServiceIp

           * @return EmailServiceIp

           */

          public static void main(String[] args) {

          //第一個參數 發件郵箱   第二個收件郵箱  第三個 郵件內容

            new SendMail().send("yunlong090614@163.com", "1063342004@qq.com", "更改密碼校驗", "尊敬的用戶你好,您的校驗碼為:65432</br>xxxx");

          }

          posted @ 2016-04-03 11:04 何云隆 閱讀(156) | 評論 (0)編輯 收藏

          jstl用系統時間進行判斷數據時間

          <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
          <jsp:useBean id="now" class="java.util.Date" />

           <c:set var="currentday">
                  <fmt:formatDate value="${now}" type="both" dateStyle="long" pattern="yyyy-MM-dd" var="nowdate"/>
                  </c:set>
                  ${nowdate} > ${result.openEndTimeOpen }=${nowdate > result.openEndTimeOpen}
               

          posted @ 2015-10-09 09:57 何云隆 閱讀(391) | 評論 (0)編輯 收藏

          plsqldevelop連接到不到數據庫


          安裝32位的Oracle客戶端( instantclient-basic-win32-11.2.0.1.0)。Win7 64位系統暫無PLSQLDeveloper,所以下一個32位的。

            下載instantclient-basic-win32-11.2.0.1.0.zip (一定得是32位的,不要下錯了版本,Oracle官網有下載),將其解壓至Oracle安裝目錄的Product下(本機命名為:instantclient_11_2):D:\Oracle\app\Dell\product\instantclient_11_2

          拷貝數據庫安裝根目錄下的一個文件夾:D:\Oracle\app\Dell\product\11.2.0\dbhome_1

          \NETWORK到Oracle客戶端目錄下D:\Oracle\app\Dell\product\instantclient_11_2(其實只需要 NETWORK\ADMIN\tnsnames.ora)



           修改oracle客戶端tnsnames.ora文件(目錄在D:\Oracle\app\Dell\product\instantclient_11_2\NETWORK\ADMIN\tnsnames.ora)
           MYACCP= (DESCRIPTION=       
          (ADDRESS_LIST=            
          (ADDRESS= (PROTOCOL=tcp)(HOST=superich-accp )(PORT=1521)) ) 
          (CONNECT_DATA=(SERVICE_NAME = ACCP)         
           ) )

          posted @ 2015-09-29 15:47 何云隆 閱讀(143) | 評論 (0)編輯 收藏

          SQL按照漢字排序

          SELECT createDate,shortName,collNum,fullName FROM college
          ORDER BY CONVERT( shortName USING gbk)

          posted @ 2015-09-01 13:25 何云隆 閱讀(399) | 評論 (0)編輯 收藏

          無法啟動print spooler服務,錯誤1068

          近幾日打印東西都是不成功,顯示不能發現打印機,處理方法如下:
          啟動 print spooler服務 但是報1068錯誤,
          在運行中輸入“sc config spooler depend= rpcss”,確定后,我再去啟用Print Spooler服務,居然成功了。我也不知道這是個什么命令,但是問題解決了,就要謝謝網絡上的高手們!

          posted @ 2015-08-30 08:10 何云隆 閱讀(185) | 評論 (0)編輯 收藏

          JSP中EL表達式三元(三目)運算符的使用

          Java中的三元運算符為:條件?條件為true值:條件為false的值
          EL也有一樣的運算符,用EL的三元運算符有時可以代替c:choose標簽,為我們的工作省下很大力氣。

          比如gender為0顯示男,其余顯示女,我們可以這么寫:

          <c:choose>
          <c:when test="${gender eq 0}"></c:when>
          <c:otherwise></c:otherwise>
          </c:choose>

          但是不是顯得太麻煩了?其實我們這里就可以使用EL表達式中的三元運算符了,上面可以簡化為:

          ${gender eq 0?"男":"女"}

          這樣是不是簡練了很多?在JSTL和EL處理非A即B的時候,三元運算符簡單了許多。

          轉載請注明:觀測者 » JSP中EL表達式三元運算符的使用

          posted @ 2015-08-25 11:03 何云隆 閱讀(2733) | 評論 (0)編輯 收藏

          打 war包命令

          jar -cvf safety.war *
          打 war包命令

          posted @ 2015-08-19 10:18 何云隆 閱讀(133) | 評論 (0)編輯 收藏

          jquery校驗輸入框內容

               摘要:  引用地址http://www.cnblogs.com/xdp-gacl/p/3467245.html 用Jquery控制文本框只能輸入數字和字母   在公司開發WinForm項目時,發現公司自主研發的textbox控件非常強大,可以實現"只能輸入數字"、"只能輸入字母"和"只能輸入數字和字母"的三種輸入限制,這樣就可以精確控制用戶輸入的內容范圍,讓"用戶永遠沒有辦法輸入...  閱讀全文

          posted @ 2015-05-08 11:22 何云隆 閱讀(444) | 評論 (0)編輯 收藏

          svn更新失敗提示locked

          SVN更新失敗,提示locked

          • 瀏覽:3571
          • |
          • 更新:

           

          產生這種情況大多是因為上次svn命令執行失敗且被鎖定了,需要刪除文件夾中的lock文件,即可解鎖。這里介紹3種方法:

          方法一.直接進行cleanup;對較小的文件比較管用,文件稍大些等待時間很長或不起作用;

           

          方法二.選擇文件,右鍵執行release lock;等待時間較長;

           

          方法三.手動刪除鎖定文件:

           1.在運行中輸入cmd進入命令行; 2.在命令提示符下cd 到svn項目出現問題的文件所在目錄下; 3.執行命令del lock /q/s 4.等待刪除lock文件成功,重新更新SVN。

          posted @ 2015-03-25 15:03 何云隆 閱讀(291) | 評論 (0)編輯 收藏

          廣禾養老文化村

          廣禾養老文化村
          首頁地址http://202.199.162.210:8080/IntelligentNursing/index/toIndex
          展示效果

           
           


          posted @ 2014-08-26 16:18 何云隆| 編輯 收藏

          打開eclipse彈出Error:could not open D:\java\lib\i386\jvm.cfg'

          打開eclipse彈出Error:could not open D:\java\lib\i386\jvm.cfg'
          運行中 輸入regedit 
           
          沒有修改注冊表,解決辦法是: 
          重新安裝JDK時注冊表中\HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environemt\1.6 項目下的JavaHome和RuntimeLib設置沒有更新,將這兩個項目更正即可.
           
           

          posted @ 2014-05-24 22:05 何云隆 閱讀(547) | 評論 (0)編輯 收藏

          安裝Eclipse Html Editor

          安裝Eclipse Html Editor 轉

          分類: Java 1431人閱讀 評論(0) 收藏 舉報
            最近在eclipse中開發android項目,用到了jquery mobile框架,則會涉及到新建html文件,發現eclipse不自帶新建html文件的插件,必須得新建一個其他形式的文件,譬如xml格式的文件,然后重命名,后綴名改成html,覺得這樣老麻煩的,所以在網上發現了Eclipse HTML Editor,不過此插件似乎只支持新建html文件,不支持其格式化。網上看了其他一個html格式化的插件Eclipse Tidy,不過用了后,發現格式化后的html一點都不符合代碼審讀標準。也不知道是不是自己哪邊沒設置好,還是本來就是那樣。

             現在就暫先不管Eclipse Tidy了,看看如何安裝Eclipse HTML Editor。

          1.下載GEF(依賴包):

          http://www.eclipse.org/downloads/download.php?file=/tools/gef/downloads/drops/3.7.2/R201201171043/GEF-ALL-3.7.2.zip

          然后解壓,把解壓得到的features和plugins兩文件夾放到eclipse安裝目錄下plugins文件夾中

          2.下載HTMLEditor

          http://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=EclipseHTMLEditor

          只有一個tk.eclipse.plugin.htmleditor_2.1.0.jar文件

          直接復制到eclipse\plugins里面

          posted @ 2014-04-03 15:15 何云隆 閱讀(176) | 評論 (0)編輯 收藏

          mysql 解決全連接問題

               摘要: 基本資料:mysql> select version();+-----------+| version() |+-----------+| 5.0.16 |+-----------+ mysql> select * from t1;+----+------+| id | name |+----+------+| 1 | aa || 2 | bb || 3 | cc |+---...  閱讀全文

          posted @ 2014-03-03 19:30 何云隆 閱讀(350) | 評論 (0)編輯 收藏

          ListView實現RadioButton的功能有bug改進

          前言:之前做的ListView實現RadioButton的功能有bug,當ListView控件的內容超出屏幕可見區域時,滑動ListView控件會報錯,下面有為什么出錯和解決方法進行的注解,不多說了,看源碼,有更好的解決辦法請指教

          1,MainActivity.java

          package com.excetop.listradio;

          import android.app.Activity;
          import android.os.Bundle;
          import android.util.Log;
          import android.view.View;
          import android.view.ViewGroup;
          import android.widget.BaseAdapter;
          import android.widget.Button;
          import android.widget.CompoundButton;
          import android.widget.ListView;
          import android.widget.RadioButton;
          import android.widget.CompoundButton.OnCheckedChangeListener;

          public class MainActivity extends Activity {
              private static final String TAG = "MainActivity";
              private ListView listView;
              @Override
              public void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.main);
                  listView = (ListView) this.findViewById(R.id.list);
                  MyAdapter adapter = new MyAdapter();
                  listView.setAdapter(adapter);
              }
              private class MyAdapter extends BaseAdapter{
                  private String[] s = new String[]{"a","b","c","d","e","a","b","c","d","e","a","b","c","d","e","a","b","c","d","e"};
                  private int temp = -1;

                  @Override
                  public int getCount() {
                      // TODO Auto-generated method stub
                      return s.length;
                  }

                  @Override
                  public Object getItem(int position) {
                      // TODO Auto-generated method stub
                      return null;
                  }

                  @Override
                  public long getItemId(int position) {
                      // TODO Auto-generated method stub
                      return 0;
                  }

                  @Override
                  public View getView(int position, View convertView, ViewGroup parent) {
                      convertView = MainActivity.this.getLayoutInflater().inflate(R.layout.item, null);  //解決辦法: 每次都重新獲取View
                      Button button = (Button) convertView.findViewById(R.id.button);
                      button.setText(s[position]);
                      RadioButton radioButton = (RadioButton) convertView.findViewById(R.id.radioButton);
                      radioButton.setId(position);  //把position設為radioButton的id
                      radioButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
                          
                          @Override
                          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                              
                              if(isChecked){
                                  //這段代碼來實現單選功能
                                  if(temp != -1){
                                      RadioButton tempButton = (RadioButton) MainActivity.this.findViewById(temp);
                                      if(tempButton != null){
                                         tempButton.setChecked(false);
                                      }
                                      
                                  }
                                  
                                  temp = buttonView.getId();
                                  Log.i(TAG,"you are women- -   " + isChecked + "   " + temp);
                                  
                              }
                          }
                      });
                      
                      //這里實現單選框選的回顯,解決了單選框移出屏幕范圍未選中狀態
                      if(temp == position){
                          radioButton.setChecked(true);
                      }
                      return convertView;
                  }
          //            Holder holder;
          //            if(convertView == null){    //1,當第一次加載ListView控件時  convertView為空 
          //                convertView = MainActivity.this.getLayoutInflater().inflate(R.layout.item, null); //所以當ListView控件沒有滑動時都會執行這條語句
          //                holder = new Holder();
          //                convertView.setTag(holder);
          //            }else{
          //                holder = (Holder) convertView.getTag();
          //            }
          //            
          //            holder.button = (Button) convertView.findViewById(R.id.button);
          //            holder.button.setText(s[position]);
          //            
          //            holder.radioButton = (RadioButton) convertView.findViewById(R.id.radioButton);   //
          //            holder.radioButton.setId(position);  //2,因為這里對radioButton的id進行重新設置,滑動ListView時convertView不為空,上面的語句就沒法得到radioButton對象,這條語句就會報空指針異常
                    
          //            holder.radioButton.setOnCheckedChangeListener(new OnCheckedChangeListener() {
          //                
          //                @Override
          //                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
          //                    
          //                    if(isChecked){
          //                        if(temp != -1){
          //                            RadioButton tempButton = (RadioButton) MainActivity.this.findViewById(temp);
          //                            tempButton.setChecked(false);
          //                            
          //                        }
          //                        
          //                        temp = buttonView.getId();
          //                        Log.i(TAG,"you are women- -   " + isChecked + "   " + temp);
          //                        
          //                    }
          //                }
          //            });
          //            return convertView;
          //        }
          //        private class Holder{
          //            private Button button;
          //            private RadioButton radioButton;
          //        }
              }
          }

          2,item.xml

          <?xml version="1.0" encoding="utf-8"?>
          <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <Button
              android:id="@+id/button"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="測試">
            
            </Button>
            
            <RadioButton
              android:id="@+id/radioButton"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              />  
           
          </LinearLayout>
          3, main.xml

          <?xml version="1.0" encoding="utf-8"?>
          <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              >
          <TextView  
              android:layout_width="fill_parent" 
              android:layout_height="wrap_content" 
              android:text="@string/hello"
              />
              <ListView
                 android:id="@+id/list"
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 />
          </LinearLayout>

          posted @ 2014-02-22 22:58 何云隆 閱讀(258) | 評論 (0)編輯 收藏

          listview與checkbox組合使用

          一,Layout

           

          1,main.xml

          <?xml version="1.0" encoding="utf-8"?>
          <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              >
          <TextView  
              android:layout_width="fill_parent" 
              android:layout_height="wrap_content" 
              android:text="@string/hello"
              />
              <ListView
                 android:id="@+id/list"
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 />
          </LinearLayout>

           

          2,item.xml

          <?xml version="1.0" encoding="utf-8"?>
          <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
            <Button
              android:id="@+id/button"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="測試">
            
            </Button>
            
            <CheckBox
              android:id="@+id/checkBox"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              />  
           
          </LinearLayout>

          二,Activity

           

          1,MainActivity

          package com.excetop.listradio;

          import java.util.ArrayList;
          import java.util.HashMap;
          import java.util.List;
          import java.util.Map;

          import android.app.Activity;
          import android.os.Bundle;
          import android.util.Log;
          import android.view.View;
          import android.view.ViewGroup;
          import android.widget.BaseAdapter;
          import android.widget.Button;
          import android.widget.CheckBox;
          import android.widget.CompoundButton;
          import android.widget.ListView;
          import android.widget.Toast;
          import android.widget.CompoundButton.OnCheckedChangeListener;

          public class MainActivity extends Activity {
           private static final String TAG = "MainActivity";
              private ListView listView;
              private Map checkMap;
           @Override
              public void onCreate(Bundle savedInstanceState) {
                  super.onCreate(savedInstanceState);
                  setContentView(R.layout.main);
                  listView = (ListView) this.findViewById(R.id.list);
                  
                  checkMap = new HashMap<String, Object>();
                  
                  MyAdapter adapter = new MyAdapter();
                  listView.setAdapter(adapter);
                
              }
           private class MyAdapter extends BaseAdapter{
            private String[] s = new String[]{"a","b","c","d","e","a","b","c","d","e","a","b","c","d","e","a","b","c","d","e"};

            @Override
            public int getCount() {
             // TODO Auto-generated method stub
             return s.length;
            }

            @Override
            public Object getItem(int position) {
             // TODO Auto-generated method stub
             return null;
            }

            @Override
            public long getItemId(int position) {
             // TODO Auto-generated method stub
             return 0;
            }

            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
             convertView = MainActivity.this.getLayoutInflater().inflate(R.layout.item, null);  //解決辦法: 每次都重新獲取View
             Button button = (Button) convertView.findViewById(R.id.button);
             button.setText(s[position]);
             final CheckBox checkBox =  (CheckBox) convertView.findViewById(R.id.checkBox);
             checkBox.setId(position);  //把position設為radioButton的id
             checkBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
              
              @Override
              public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
               
               if(isChecked){
                
                checkMap.put(String.valueOf(checkBox.getId()), checkBox.getId());
          //      Toast.makeText(MainActivity.this, String.valueOf( checkBox.getId()), 0).show();
               
               }else{
                checkMap.remove(String.valueOf(checkBox.getId()));
          //      Toast.makeText(MainActivity.this, String.valueOf( checkBox.getId()), 0).show();
               }
              }
             });
             
             if(checkMap.get(String.valueOf(position)) != null){
              checkBox.setChecked(true);
          //    Toast.makeText(MainActivity.this, String.valueOf(String.valueOf(position)), 0).show();
             }
             
             //這里實現單選框選的回顯,解決了單選框移出屏幕范圍未選中狀態
             return convertView;
            }
           }
          }

          posted @ 2014-02-22 22:56 何云隆 閱讀(221) | 評論 (0)編輯 收藏

          處理多個fragment之間replace刷新問題

           處理多個fragment之間replace刷新問題[轉]
           每次創建fragment對象都會重新走onCreateView方法,所以多個fragment互相替換會重新刷新界面,
           在application中創建一個View,保持onCreateVIew中創建的View
           每次走onCreateView的時候判斷application中是否保持了View,如果為null,重新inflater走initView和initData方法,不為nul得到父類,移除子View,不然有父id無法再加入布局中,
           以下是代碼:
           @Override
           public View onCreateView(LayoutInflater inflater, ViewGroup container,
             Bundle savedInstanceState) {
            
            GalaxyApplication galaxyApplication = (GalaxyApplication) getActivity().getApplication();
            View recommendView = galaxyApplication.getRecommendView();
            if(recommendView != null){
             
             ViewGroup group = (ViewGroup) recommendView.getParent();
             group.removeAllViews();
             
             return recommendView;
            }
            
            View fmRootView = inflater.inflate(R.layout.fragment_recommend, container,false);
            
            
           
            
            initView(fmRootView);
            initData();
            galaxyApplication.setRecommendView(fmRootView);
            Logger.d("fragment: ", "onCreateView");
            return fmRootView;
           } 

           如有好的方法,處理onCreateView刷新問題  歡迎留言。 

          posted @ 2014-02-22 22:55 何云隆 閱讀(555) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 常宁市| 富阳市| 定远县| 台江县| 珠海市| 兴安盟| 扶沟县| 大竹县| 桃源县| 清远市| 茂名市| 舟山市| 包头市| 喀什市| 浪卡子县| 都匀市| 盐城市| 涿鹿县| 广东省| 墨江| 陆良县| 阳城县| 徐闻县| 手游| 登封市| 民丰县| 西乌珠穆沁旗| 广饶县| 平远县| 华池县| 赞皇县| 龙海市| 枞阳县| 上高县| 赣州市| 正蓝旗| 博湖县| 汉寿县| 响水县| 吐鲁番市| 色达县|