自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 收藏
  • 关注

原创 JUnit 4 with Hamcrest

A good starting place is the assertThat() method that can now almost always be used in place of the traditional assertEquals(). assertThat() can be found in org.junit.Assert, but it defines using Hamc

2014-08-26 12:42:15 597

原创 linux shell

#!/bin/shfor line in $(cat all_files.txt)do if [ -f "$line" ]; #A folder like /tmp/a/b is also true for -e, there is a whitespace before and after "-f". then sed 's/abc/def/g' $line >> ${line%.*

2014-08-25 21:24:26 387

原创 Bash Shell:判断文件是否存在

#!/bin/bashfile="/etc/hosts"if [ -f "$file" ]then echo "$file found."else echo "$file not found."fi

2014-08-25 18:20:07 769

原创 junit

我们先来看一个测试case: @Test public void test3() { ArrayList strings = new ArrayList(); strings.add("a"); strings.add("d"); strings.add("c"); strings.add("b");

2014-08-25 16:22:20 591

原创 h2数据库数据查看

如果想要查看数据库信息,可在web.xml文件中加入如下配置: H2Console org.h2.server.web.WebServlet 1 H2Console /memerydb/console/* 浏览器中输入:http://localhost:8080/memerydb

2014-08-25 08:54:12 3337

原创 linux系统下制作u盘启动盘

平时用linux系统比较少,对于某些linux软件非常不了解。

2014-08-23 01:37:08 670

原创 div标签以及jsp中嵌入java代码

<% List files = (List) request.getAttribute("files"); if (files.size() > 2) { %> Click here to see more files... <% } %>

2014-08-22 15:22:38 1411

原创 文件上传操作

@RequestMapping(value = "/upload", method = RequestMethod.POST) public String upload(@RequestParam("files") MultipartFile[] files, Model model) { MyFile myFile = new MyFile(); Str

2014-08-22 12:55:05 539

原创 Shell: How to read lines in a file.

for line in $(cat all_files.txt )do echo $linedone

2014-08-20 16:36:54 497

原创 ParameterMap, ParameterType的误用

下午碰到一个特别坑的低级错

2014-08-14 17:52:17 3524

原创 mybatis自增主键的问题

mybatis自增主键有个有意思的地方

2014-08-14 14:32:53 826

转载 Mybatis ResultMap的使用

MyBatis 会在幕后自动创建一个 ResultMap,基于属性名来映射列到 JavaBean 的属性上。如果列名没有精确匹配,你可以在列名上使用 select 字句的别名(一个 基本的 SQL 特性)来匹配标签。比如: select user_id as "id", user_name as "userName",

2014-08-14 11:53:24 513

原创 spring, mybatis集成中的注解用法

1. 在spring + mybatis集成中,Dao层没必要写

2014-08-13 17:45:57 941

原创 mybatis, spring基于mapper文件和注解的集成

1. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.Integer'

2014-08-13 13:46:06 733

原创 h2内存数据库和mysql数据库的区别

h2内存数据库:DROP table if exists 'q_user';CREATE TABLE `q_user` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增主键', `user_id` varchar(32) NOT NULL COMMENT '用户唯一标识', `nickname` varchar(32) NOT

2014-08-13 01:00:39 19516

原创 mybatis接口实现

1. dao.xml<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context

2014-08-12 21:58:40 578

原创 spring中声明式事务管理标签

1. 该标签的作用时的

2014-08-12 16:02:19 656

原创 用户更新的sql语句

update(User user)的实现:private final String UPDATE_USER = "UPDATE q_user SET user_id = ?, nickname = ?, realname = ?,password = ?, email = ?,status = ?, last_login_time = ? WHERE id = ? ";

2014-08-12 14:35:13 1249

原创 Ajax请求,Controller处理,并跳转

用了很长时间调试这个url跳转的问题.

2014-08-11 20:43:54 7097

转载 拦截器验证用户是否登录

public class LoginInterceptor implements HandlerInterceptor { private static final Logger LOGGER = LoggerFactory.getLogger(LoginInterceptor.class); @Override public boolean preHandle(Htt

2014-08-10 23:28:49 1370

转载 spring mvc 拦截器配置

dispatcher-servlet.xml<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/sc

2014-08-10 23:18:20 560

原创 cookie添加

protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String userName = req.getParameter("uid"); String password = req.getParam

2014-08-10 16:07:28 340

转载 枚举

package com.demo.mybatis.sample.bean;public enum Role { USER(0, "普通用户"), MANAGER(1, "管理员"); private int code; private String text; private Role(int code, String text) { this.code = code;

2014-08-07 16:30:09 367

原创 controller内部跳转

1. 热 @RequestMapping(value = "/login", method = RequestMethod.POST) public String loginPost(@RequestParam String userId, @RequestParam String password) { User user = userService.query

2014-08-07 11:51:01 897

原创 Spring mvc中几种不同的接收参数的方法 @PathVariable @RequestBody @RequestParam。

总结:

2014-08-07 11:41:06 619

原创 jstl遇到的问题

当从controller传入前端一个List时,前端哟你

2014-08-07 10:36:21 471

原创 类似mybatis的功能

今天老师讲了mybatis的入门,作为入门基础没有将太多的mybatis的用法.而是通过一个实例,讲解了mybatis

2014-08-06 23:58:04 897

转载 Controller通过@RequestBody接收参数

@RequestMapping(value="/update.json") @ResponseBody public Object update(@RequestBody User user) { user.setStatus(1); user.setLast_login_time(new Date()); boolean resu

2014-08-06 16:53:52 2241

转载 jsp + jquery + json

<%-- Created by IntelliJ IDEA. User: xuan Date: 14-8-1 Time: 下午1:38 To change this template use File | Settings | File Templates.--%> update user info body{

2014-08-06 16:41:37 471

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除