- 博客(29)
- 资源 (2)
- 收藏
- 关注
原创 springmvc直接不经过controller访问WEB-INF中的页面
在springDispatcherServlet-servlet.xml中添加如下两句 <mvc:view-controller path="/success" view-name="success"/> <mvc:annotation-driven></mvc:annotation-driven>第一句指定逻辑视图名称所对应的物理路径但是只写第一句会导致通过controller访问
2015-03-25 21:18:17 6031
原创 springmvc获取参数
@RequestParam@RequestParam 用来请求request中的参数,相当于request.getParameter() 其中有三个属性: 1、value用来指定要取得参数的key 2、required 所取的参数是否必须存在,如果true表示必须存在,若不存在则抛出异常 3、default 指定该value的默认值类实现代码: @Req
2015-03-25 19:45:23 655
原创 springmvc实现REST中的GET、POST、PUT和DELETE
spring mvc 支持REST风格的请求方法,GET、POST、PUT和DELETE四种请求方法分别代表了数据库CRUD中的select、insert、update、delete,下面演示一个简单的REST实现过程。
2015-03-24 13:10:16 21102 1
原创 spring mvc配置过程
开发spring工程建议安装spring tools sutite新建一个j2ee工程,在其中导入如下包 commons-logging-1.1.1.jar spring-aop-4.0.0.RELEASE.jar spring-beans-4.0.0.RELEASE.jar spring-context-4.0.0.RELEASE.jar spring-co
2015-03-23 22:05:18 1497
原创 eclipse自动补全设置
默认情况下,eclipse的代码自动补全功能是在“.”之后出现的,像VS,XCODE等IDE都是输入一个字母就提示的,eclipse通过配置也能实现。 Windows——>Preferences——>Java–>Editor–>Content Asist中有一个Auto activation triggers for Java,默认情况下只有一个“.”,把这个理改成”.abcdefghijklmn
2015-03-23 17:31:24 553
原创 Python遇到 UnicodeDecodeError
这是因为.py文件保存的格式有问题。可以在第一行添加注释# -*- coding: utf-8 -*-
2015-03-23 15:28:14 475
转载 Spring MVC 教程,快速入门,深入分析
转自 http://elf8848.iteye.com/blog/875830目录 一、前言二、spring mvc 核心类与接口三、spring mvc 核心流程图四、spring mvc DispatcherServlet说明五、spring mvc 父子上下文的说明六、springMVC-mvc.xml 配置文件片段讲
2015-03-20 23:41:19 441
原创 Java IO之简单输入输出
Java中的IO分为两个部分,以InputStream和Reader为基类的输入类,以OutputStream和Writer为基类的输出类。其中InputStream和OutputStream以字节为单位进行IO,而Reader和Writer以字符为单位。除了输入输出,还有一系列类库称为Filter,或成为装饰器。对于输入可用FilterInputStream和FilterReader的派生类,输出
2015-03-12 19:41:20 3192
转载 Linux 安装php环境
一、使用screen(可选) 由于编译安装Nginx Apache PHP MySQL等软件会花费比较长的时间,难免会出现由于网络意外中断而导致安装也中断了,所以为了避免此问题,可以用screen来安装。 screen的使用方法如下: 1、安装screen ubuntu/debian系统:apt-get install -y screenCentos/redhat系统:yum install
2015-03-12 14:10:33 1370
原创 Java IO之File
FILE类是用来实现获取文件、文件夹的类库工具,File并非像类名所表示的那样只是用来表示文件,它还可以用来表示文件夹。所以可以用File来获取一个目录下的所有文件,甚至是文件夹中的文件。 一个简单的获取当前文件目录下所有文件及文件夹的方法public static void dir() { File dir = new File(".");// "."表示当前文件所在目录
2015-03-12 13:15:12 2344
原创 Set Matrix Zeroes
https://leetcode.com/problems/set-matrix-zeroes/Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use extra space?A straight forward solutio
2015-03-11 23:24:37 484
原创 Merge Sorted Array
https://leetcode.com/problems/merge-sorted-array/Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal t
2015-03-10 22:07:40 355
原创 Validate Binary Search Tree
https://leetcode.com/problems/validate-binary-search-tree/Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:* The left subtree of a node contai
2015-03-10 00:37:24 387
原创 Climbing Stairs
https://leetcode.com/problems/climbing-stairs/You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to
2015-03-09 22:06:52 379
原创 Valid Palindrome
https://leetcode.com/problems/valid-palindrome/Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,“A man, a plan, a canal: Panama”
2015-03-09 00:18:55 359
原创 JAVA容器之List
List的实现类主要是ArrayList和LinkedList,两个主要的差别是ArrayList是通过数组实现的,但LinkedList是通过链表实现。 可以想象,ArrayList在随机访问效率上远高于LinkedList,因为LinkedList访问一个元素必须从头节点开始依次访问知道找到目标节点,所以时间复杂度为O(n),而ArrayList的随机访问复杂度几乎是O(1)。 但频繁进行插
2015-03-08 16:57:37 3046
原创 JAVA容器分析之概述
其中黑色粗线标注的为常用容器,实线框表示已实现容器,点线框表示接口,虚线框表示abstract类(已实现部分接口方法)本系列文章将主要讲述List、Set、Queue、Map及其实现类
2015-03-08 16:54:34 443
原创 Word Ladder
Word Ladderhttps://oj.leetcode.com/problems/word-ladder/Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:1. Only one l
2015-03-07 14:56:37 493
原创 Merge Two Sorted Lists
https://oj.leetcode.com/problems/merge-two-sorted-lists/Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two l
2015-03-05 22:15:22 366
原创 Valid Parentheses
https://oj.leetcode.com/problems/valid-parentheses/Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must c
2015-03-05 22:09:02 427
转载 LeetCode题目索引-难度及面试频率
1Two Sum25arraysort setTwo Pointers2Add Two Numbers34linked listTwo Pointers
2015-03-05 00:56:06 837
原创 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
2015-03-05 00:55:48 373
原创 Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Have you thought about this?Here are some good questions to ask before coding. Bonus po
2015-03-05 00:55:11 319
原创 Next Permutation
https://oj.leetcode.com/problems/next-permutation/Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangemen
2015-03-05 00:54:07 398
原创 ZigZag Conversion
https://oj.leetcode.com/problems/zigzag-conversion/The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixe
2015-03-05 00:53:39 354
原创 Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo
2015-03-05 00:51:58 396
原创 Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a li
2015-03-05 00:50:35 386
原创 Two Sum
https://oj.leetcode.com/problems/two-sum/Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two
2015-03-05 00:48:47 339
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人