漫步至黄昏
漫步至黄昏 · 共 46 篇文章
mysql 多字段模糊查询
select * from transportorders where concat(DepartureFromAddress,ReachToAddress) like '%海关%'; concat函数如有不明请行查看mysql参考手册
2014-06-12 17:46 · mysql · 评论(0)
location.href 传参乱码解决方法
第一种: 先通过JS encodeURI 方法将url进行转码 location.href = encodeURI("findTransportordersByPrincipalUserIdNotNullVehicleInfoAction?keyword="+keyword); java 解码 String keyword = new String(request.getParameter("keyword").getBytes("ISO8859-1"), "UTF-8"); 第二种: 先通过encodeURIComponent 的两次转码 location.href = "findTran…
2014-06-12 17:01 · Java · 评论(0)
利用ScheduledThreadPoolExecutor 实现定时计划
servlet 代码 public void init() throws ServletException { // Put your code here int period = 1;/*单位秒。每小时执行一次,如果是天,则再为24*/ int initDelay = 0;/*调动延迟时间,调试时设为0,即时开始。正常运行时,须设为晚上*/ UpdateThread updateThread=new UpdateThread(); /*通过ScheduledThreadPoolExecutor类,进行定时调度*/ ScheduledThreadPoolExecutor executor =…
2014-06-10 16:29 · Java · 评论(0)
jquery.paginate.js 分页插件的使用
在JSP页面需要引入样式 style.css 引入js jquery.js 和 jquery.paginate.js 以及一个id 为pagination的div <div id="pagination" class="pagination"></div> 需要两个 <input type="hidden" id="maxPage" value="${maxPage }"> <input type="hidden" id="page" value="${page }"> 获取action传递过来的参数 js部分: $(function(){ var page_index=$("#page")…
2014-06-10 11:23 · Jquery · 评论(0)
getHibernateTemplate() 分页查询
分页查询: final String hql = "from TransportOrders t where t.carriageUserId!=null order by t.orderId desc"; getHibernateTemplate().executeFind( new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException, SQLException { Query query = session.createQuery(hql); query.…
2014-06-09 10:10 · SSH · 评论(0)
Jquery 做无刷新删除行时,需要用window.location.reload(); 重载
window.location.reload();
2014-06-09 10:03 · Jquery · 评论(0)
spring超级简单入门例子
首先是一个名叫Action的接口定义了一个execute()方法 package net.xiaxin.spring.qs; public interface Action { public String execute(String str); } 实现类LowerAction package net.xiaxin.spring.qs; public class LowerAction implements Action { private String message; @Override public String execute(String str) { // TODO Auto-…
2014-04-28 22:56 · Spring4.0 · 评论(0)
java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:153) at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplication…
2014-04-28 22:26 · 异常 · 评论(0)
简单方法找出A数组有B数组没有的值
public static void main(String[] args) { String a[]=new String[]{"a","b","c","e"}; String b[]=new String[]{"b","c","d"}; for (int i = 0; i < a.length; i++) { boolean isEq=false; for (int j = 0; j < b.length; j++) { if (a[i].equals(b[j])) { isEq=true; break; } } if (!isEq) { System.out.println(a[i])…
2014-04-28 21:41 · Java · 评论(0)
SSH 简单C3PO连接池配置
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="com.mysql.jdbc.Driver"> </property> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/our56?useUnicode=true&characterEncoding=utf-8"> </property> <property name="user" value="r…
2014-04-22 23:55 · SSH · 评论(0)
uploadify3.2.1+struts2实现多文件上传
uploadify.css 中需要更改图片路径,否则不显示"X" index.jsp上传页面 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//…
2014-03-29 23:39 · struts2 · 评论(0)
nginx-1.4.7+php-5.5.10-nts-Win32-VC11-x86+RunHiddenConsole 配置支持PHP
1.更改nginx 的nginx.conf文件 打开并找到如下内容 location ~ \.php$ { root c:/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 2.更改php中的php.ini-development 文件名为php.ini 并打开找到cgi.fix_pathinfo=1 去掉前面的' ; ' 3.更…
2014-03-27 19:19 · 服务器 · 评论(0)
MyBatis 实现简单的 增加 查找
一个简单的POJO类 package com.test.pojo; public class User { private String name; private String password; public User(){ } public User(String name,String password){ this.name=name; this.password=password; } public String getName() { return name; } public void setName(String name) { this.name = name; } pu…
2014-03-21 16:10 · MyBatis · 评论(0)
spring3.0通过注解实现登录简单实例
部分代码(可下载附件浏览全部) UserDao package com.spring.dao.impl; import java.sql.ResultSet; import java.sql.SQLException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowCallbackHandler; import org.springf…
2014-03-20 17:24 · Spring3.0 · 评论(0)
Java中用MD5保存用户密码 简单实例
/** * 生成MD5简单方法 * @param str * @return */ public StringBuilder getMD5(String str){ byte [] buf=str.getBytes(); MessageDigest md5; StringBuilder sb=new StringBuilder(); try { md5 = MessageDigest.getInstance("MD5"); md5.update(buf); byte [] tmp=md5.digest(); for (byte b:tmp) { sb.append(Integer.toHex…
2014-03-19 21:36 · Java · 评论(0)