- 博客(16)
- 资源 (4)
- 收藏
- 关注
原创 spring mvc能访问到Controller但是显示404问题解决办法
今天,在配置Spring mvc时碰见一个很奇怪的问题,路径明明是对的,但是访问页面一直显示404 Not Found。启动调试,跟踪代码,发现请求能够进入到Controller中,但是返回jsp时却出现错误。上网查了一下,发现是web.xml配置有问题。我的配置文件如下:<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmln
2016-08-31 17:27:01 18209 1
原创 【Python脚本】-爬虫得到CSDN博客的文章访问量和评论量
对于CSDN博客,我们比较关注的就是文章的访问量和评论量。但是当文章多了之后,我们想看每篇文章的访问量变得很费劲。通过爬虫,我们可以把每篇博客的基本信息都能得到。之后,可以再进行进一步的统计分析。脚本如下:#!usr/bin/python# -*- coding: utf-8 -*-import urllib2import refrom bs4 import BeautifulSoup
2016-08-31 15:37:17 2459 1
原创 【Spring学习笔记七】-Spring MVC基本配置和实例
一、spring mvc基本配置对于spring mvc的配置,如果是maven项目,只需要简单地加入spring mvc和Servlet的依赖就可以了。下面所说的配置,指的是没有使用maven的项目配置。首先,新建一个web项目。在new->project->web->Dynamic Web Project,输入工程名即可。新建后的web项目结构如下:之后,先导入spring
2016-08-30 13:36:25 9571
转载 【Spring学习笔记六】-Spring MVC框架
一、Spring mvc介绍Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面。Spring 框架提供了构建 Web 应用程序的全功能 MVC 模块。使用 Spring 可插入的 MVC 架构,可以选择是使用内置的 Spring Web 框架还可以是 Struts 这样的 Web 框架。Spring web mvc和Struts2都属
2016-08-22 18:21:59 1226
原创 【Spring学习笔记五】-Bean的作用域
一、Bean作用域类型Spring定义了多种作用域,可以基于这些作用域创建Bean。Spring包括以下四种作用域:(1) 单例(Singleton):在整个应用中,只创建bean的一个实例(2) 原型(Prototype):每次注入或者通过Spring应用上下文获取时,都会创建一个新的bean实例(3) 会话(Session):在Web应用中,为每个会话创建一个bean实例。
2016-08-22 10:36:29 1200
原创 【Spring学习笔记四】-自动装配Bean
上一次博客写到Spring有两种依赖注入的方式,设值注入和构造注入,详情点击这里:http://blog.csdn.net/kevin_zhai/article/details/52184901。上述两种注入方式的例子,都是通过XML配置文件来装配Bean的。除此之外,Spring提供了一种更加方便的装配Bean的方法,即利用@Autowired注解进行自动装配。一、@Autowired基本使
2016-08-18 10:47:11 4075 4
原创 【Python脚本】-Python查找可用代理IP
在用Python爬虫时,我们有时会用到IP代理。无意中发现一个免费代理IP的网站:http://www.xicidaili.com/nn/。但是,发现很多IP都用不了。故用Python写了个脚本,该脚本可以把能用的代理IP检测出来。脚本如下:#encoding=utf8import urllib2from bs4 import BeautifulSoupimport urllibimp
2016-08-14 15:48:52 6547 2
原创 【Spring学习笔记三】-依赖注入的两种方式
依赖注入通常有两种方式:设值注入和构造注入。设值注入,即Spring容器使用属性的setter方法来注入被依赖的实例。构造注入,即Spring容器使用构造器来注入被依赖的实例。一、设值注入设值注入是指Spring容器使用属性的setter方法来注入被依赖的实例。这种注入方式简单、直观,因而在Spring的依赖注入里大量使用。还是以上一篇博客中讲到的人和斧子为例。首先,定义人和斧子接口。
2016-08-11 17:43:04 1793
原创 【Spring学习笔记二】-理解依赖注入
为了更好的理解依赖注入,我们先从一个简单的例子说起。一个人(我们可以看做是一个Java实例,调用者),他因为劳动,需要一把斧子(在这里也可以看做是一个Java实例,被调用者)。在原始社会里,几乎没有任何分工,想要斧子,就必须要自己动手去打造。在Java中,就相当于,调用者自己创建被调用者,通常做法就是用new关键字创建一个Java对象。进入到工业社会,斧子开始在工厂生产,想要斧子的话,只需
2016-08-11 15:28:34 769
原创 【leetcode Database】262. Trips and Users
题目:The Trips table holds all taxi trips. Each trip has a unique Id, while Client_Id and Driver_Id are both foreign keys to the Users_Id at theUsers table. Status is an ENUM type of (‘completed
2016-08-09 11:22:00 4326
原创 【leetcode Database】178. Rank Scores
题目:Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive intege
2016-08-08 17:06:10 4298
原创 【leetcode Database】180. Consecutive Numbers
题目:Write a SQL query to find all numbers that appear at least three times consecutively.+----+-----+| Id | Num |+----+-----+| 1 | 1 || 2 | 1 || 3 | 1 || 4 | 2 || 5 | 1 |
2016-08-08 15:51:12 3804
原创 【leetcode Database】185. Department Top Three Salaries
题目:The Employee table holds all employees. Every employee has an Id, and there is also a column for the department Id.+----+-------+--------+--------------+| Id | Name | Salary | Departmen
2016-08-08 14:25:14 3711
原创 【leetcode Database】177. Nth Highest Salary
题目:Write a SQL query to get the nth highest salary from the Employee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 || 3 | 300 |+----+--------+F
2016-08-04 18:17:17 4463
原创 【leetcode Database】196. Delete Duplicate Emails
题目:Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id.+----+------------------+| Id | Email |+-
2016-08-04 13:36:50 3409
原创 【leetcode Database】184. Department Highest Salary
题目:The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.+----+-------+--------+--------------+| Id | Name | Salary |
2016-08-03 18:47:07 4211
jrebel插件
2016-08-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人