hyljava

2014年2月16日 #

解决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 何云隆 阅读(356) | 评论 (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 何云隆 阅读(142) | 评论 (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 何云隆 阅读(376) | 评论 (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 何云隆 阅读(132) | 评论 (0)编辑 收藏

SQL按照汉字排序

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

posted @ 2015-09-01 13:25 何云隆 阅读(386) | 评论 (0)编辑 收藏

无法启动print spooler服务,错误1068

近几日打印东西都是不成功,显示不能发现打印机,处理方法如下:
启动 print spooler服务 但是报1068错误,
在运行中输入“sc config spooler depend= rpcss”,确定后,我再去启用Print Spooler服务,居然成功了。我也不知道这是个什么命令,但是问题解决了,就要谢谢网络上的高手们!

posted @ 2015-08-30 08:10 何云隆 阅读(171) | 评论 (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 何云隆 阅读(2653) | 评论 (0)编辑 收藏

打 war包命令

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

posted @ 2015-08-19 10:18 何云隆 阅读(116) | 评论 (0)编辑 收藏

jquery校验输入框内容

     摘要:  引用地址http://www.cnblogs.com/xdp-gacl/p/3467245.html 用Jquery控制文本框只能输入数字和字母   在公司开发WinForm项目时,发现公司自主研发的textbox控件非常强大,可以实现"只能输入数字"、"只能输入字母"和"只能输入数字和字母"的三种输入限制,这样就可以精确控制用户输入的内容范围,让"用户永远没有办法输入...  阅读全文

posted @ 2015-05-08 11:22 何云隆 阅读(431) | 评论 (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 何云隆 阅读(266) | 评论 (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 何云隆 阅读(515) | 评论 (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 何云隆 阅读(161) | 评论 (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 何云隆 阅读(338) | 评论 (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 何云隆 阅读(243) | 评论 (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 何云隆 阅读(197) | 评论 (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 何云隆 阅读(532) | 评论 (0)编辑 收藏

android设置重复背景

创建重复的背景图片


在drawable目录下创建一个repeat_bg.xml:  src是引用图片的名称

1
2
3
4
5
6
7
8
1
<?xml version="1.0" encoding="utf-8"?>
2
3
    android:src="@drawable/bg"
4
    android:tileMode="repeat" />

然后在布局的xml文件中可以这样引用:

1
2
3
4
5
6
7
8
1
<LinearLayout android:layout_width="fill_parent"
2
    android:layout_height="fill_parent"
3
    android:background="@drawable/repeat_bg">
4
</LinearLayout>

posted @ 2014-02-16 09:59 何云隆 阅读(192) | 评论 (0)编辑 收藏