本随笔记录使用Spring Boot统一处理异常。 本文实例是从数据库中根据ID查询学生信息,要求学生的年龄在14——20岁之间。小于14岁,提示“你可能在上初中”;大于20岁,提示“呢可能在上大学”。 第一步,创建枚举类ResultEnum,用来管理异常信息 第二步,创建自己的异常类Student ...
分类:
编程语言 时间:
2017-07-30 13:56:06
阅读次数:
258
项目中经常用到开发webservice接口,及调用webService接口。这里讲解如何使用cxf开发webService接口。 一、webservice介绍及理解 webservice是一种跨平台,跨语言的规范,用于不同平台,不同语言开发的应用之间的交互。 比如,平台平台淘宝、京东想获取其他快递公 ...
分类:
Web程序 时间:
2017-07-30 12:50:53
阅读次数:
231
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" c ...
分类:
Web程序 时间:
2017-07-30 11:40:37
阅读次数:
197
链接:http://poj.org/problem?id=1040 Transportation Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 4235 Accepted: 1725 Description Ruratania ...
分类:
其他好文 时间:
2017-07-30 11:36:13
阅读次数:
116
作业需求: ATM交易中心: def make_transaction(arg, tran_type, amount, *args): if tran_type == 'change': #修改密码 …… if tran_type == 'save': #存款 …… if tran_type == ...
分类:
其他好文 时间:
2017-07-29 21:24:34
阅读次数:
745
Problem An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'. Given a DNA string tt corresponding to a coding strand, ...
分类:
其他好文 时间:
2017-07-29 15:12:37
阅读次数:
113
ERROR:java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransactionFactory.newTransaction() 原因是mybatis-spring整合包是1.0的,换成1.1.1 ...
分类:
编程语言 时间:
2017-07-29 10:23:02
阅读次数:
111
近期梳理Weblogic数据源,在每一个数据源在weblogic中是xml方式存在,由于数据源较多,所以想到批量解析xml,把数据放到数据库后来解决。 需要的数据源信息: WEBLOGIC_HOSTJDBC_NAMEJNDI_NAMEDB_ALIASDB_NAMEDB_HOSTINST_PORTDB ...
分类:
编程语言 时间:
2017-07-28 22:12:38
阅读次数:
254
In this lesson, we’ll use the react-intl FormattedHTMLMessage component to display text with dynamic values along with other HTML elements to create e ...
分类:
Web程序 时间:
2017-07-28 20:59:06
阅读次数:
442
#!/usr/bin/env python # encoding:utf-8 import math import numpy import time import matplotlib.pyplot as plt def sigmoid(x): return 1.0 / (1 + numpy.ex ...
分类:
其他好文 时间:
2017-07-28 00:24:50
阅读次数:
167