spring
文章平均质量分 81
curiousby
这个作者很懒,什么都没留下…
展开
-
springboot docker jenkins 部署 对比 tomcat
下载demo springboot 详解 (二) crud 下载demo springboot 详解 (三) 多数据源 下载demo springboot 详解 (四)redis & filter2018-06-26 18:58:53 · 522 阅读 · 0 评论 -
kafka spring 实例
结果如下 kafka 代码安装 15.安装kafkacd /usr/local/wget http://mirror.bit.edu.cn/apache/kafka/0.10.0.0/kafka_2.10-0.10.0.0.tgztar xf kafka_2.10-0.10.0.0.tgzln -s /usr/local/kafka_2.10-0.10.0.0 /usr/local/kafkachown -R hdfs:hadoop /usr/local/2016-12-12 16:07:53 · 78 阅读 · 0 评论 -
springmvc cas maven sso 详解
springmvc http://download.csdn.net/download/knight_black_bob/9698720 代码已上传 ,其中 springmvc +hibernate 封装的非常好用,大家可以学习下 1.生成 钥匙串keytool -genkey -alias tomcat -keypass changeit -keyalg RSA -keystore server.keystore 2.生成证书keytool -export2016-11-30 17:14:28 · 116 阅读 · 0 评论 -
springmvc shiro
实例解析 :首先访问 http://localhost:8083/springmvchibernate/web/user/showallusers然后没有登陆 http://localhost:8083/springmvchibernate/web/user/tologin登陆过后http://localhost:8083/springmvchibernate/web/user/showallusers可以 访问 前提我是有 这个权限的如果没有该权限 就进不去2016-11-22 15:05:25 · 127 阅读 · 0 评论 -
springmvc hibernate 权限管理 权限位 权限码
ame` varchar(255) DEFAULT NULL, `right_pos` int(11) DEFAULT NULL, `right_url` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8CREATE TABLE `t_role` ( `id` int(11) NOT NULL AUTO_INCREMENT,2016-11-22 10:20:52 · 167 阅读 · 0 评论 -
redis 实现 ip 限制
复杂,然后建议他用redis 或者memcached ,因为都有expired 方法,楼主没有使用,本人就写一个吧 。。。 /* * Project: springmvchibernate * * File Created at 2016年11月4日 * * Copyright 2016 CMCC Corporation Limited. * All rights reserved. * * This softwar2016-11-04 14:21:32 · 562 阅读 · 0 评论 -
spring 注入方式
原创 2016-08-31 14:37:54 · 58 阅读 · 0 评论 -
mybatis springjdbc 插入数据获取主键
(#{nameZh,jdbcType=VARCHAR},#{parentId,jdbcType=SMALLINT},#{showOrder,jdbcType=SMALLINT},#{deleteStatus,jdbcType=BIT},#{description,jdbcType=VARCHAR})</insert>或<insert id="add" paramet2016-03-09 12:21:14 · 198 阅读 · 0 评论 -
(阿里巴巴 dubbo,有数据库,可执行 )dubbo zookeeper spring demo
配置文件zoo-example.cfg改为zoo.cfg,zookeeper默认寻找zoo.cfg配置文件# The number of milliseconds of each ticktickTime=2000# The number of ticks that the initial # synchronization phase can takeinitLimit=10# The number of ticks that can pass between # se原创 2016-02-22 17:33:27 · 102 阅读 · 0 评论 -
校验Referer头,防范CSRF(跨站请求伪造)攻击的拦截器
com.opensymphony.xwork2.ActionInvocation;import com.opensymphony.xwork2.interceptor.AbstractInterceptor;import com.trace.web.utils.Constants;/** * 对管理员操作,校验Referer头,防范CSRF(跨站请求伪造)攻击的拦截器 * @author admin */public class AuthInterceptor extend2015-12-29 10:53:48 · 4062 阅读 · 0 评论 -
解决xss漏洞
2015-12-29 10:51:09 · 270 阅读 · 0 评论 -
springboot dubbox 实例
下载demo springboot 详解 (二) crud 下载demo springboot 详解 (三) 多数据源 下载demo springboot 详解 (四)redis & filter2017-01-19 17:10:03 · 111 阅读 · 0 评论 -
spring easyrest first
t 项目该项目为 多pom项目 1.pom文件<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs2017-03-07 13:45:36 · 111 阅读 · 0 评论 -
hibernate 报错 SQL Error: 1062, SQLState: 23000
ask : ===================== scheduled ====================2018-04-12 10:50:35.164 INFO 10708 --- [cTaskExecutor-5] s.s.govZone.linstener.EventListener : ========================showandshare.spider.govZone.event.CityEvent[source=showandshare.sp2018-04-12 13:56:10 · 919 阅读 · 0 评论 -
springboot 同步解耦 异步化
2018-03-23 11:38:22 · 466 阅读 · 0 评论 -
dubbo java 发布订阅(非spring配置)
w RegistryConfig("localhost:2181"); reg.setProtocol("zookeeper"); ProtocolConfig protocol = new ProtocolConfig(); protocol.setName("dubbo"); protocol.setPort(20880);2018-02-05 17:09:30 · 535 阅读 · 0 评论 -
异常解决[ asm ClassReader failed to parse class file]
rkplace\DubboDemo\target\classes\com\baoy\base\dao\JdbcTempBaseDao.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\bean\User.class], file [D:\cache\eclipse4mvn-workplace\DubboDemo\target\classes\com\baoy\dao\impl\UserDaoImpl$原创 2018-02-02 11:10:03 · 218 阅读 · 0 评论 -
动态加载 dubbo spring
2018-02-02 11:00:01 · 352 阅读 · 0 评论 -
手写 springmvc
ceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <org.slf4j-version>1.7.9</org.slf4j-versio2018-01-16 11:15:26 · 82 阅读 · 0 评论 -
redis spring 哨兵 配置
ce)距离最后一次有效回复 PING 命令的时间超过 down-after-milliseconds 选项所指定的值, 则这个实例会被 Sentinel 标记为主观下线。 3):如果一个Master被标记为主观下线,则正在监视这个Master的所有 Sentinel 要以每秒一次的频率确认Master的确进入了主观下线状态。 4):当有足够数量的 Sentinel(大于等于配置文件指定的值)在指定的时间范围内确认Master的确进入了主观下线状态, 则Master会被标记为客观下线 5):在一般2017-10-30 13:33:25 · 162 阅读 · 0 评论 -
spring 配置文件 xsd 过高导致启动不起来
/WEB-INF/app_context/ac-redis.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 132; cvc-elt.1: Cannot find the declaration of element 'beans'. at org.springframework.beans.factory.xml.XmlBeanDefinitionReade2017-10-30 13:29:33 · 107 阅读 · 0 评论 -
dubbo admin monitor
2017-06-16 17:50:00 · 93 阅读 · 0 评论 -
spring security 详解
ns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://原创 2017-03-24 13:22:46 · 95 阅读 · 0 评论 -
spring 拦截器
001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:oxm="http://www.springframework.org/schema/oxm" xsi:schemaLocation="2015-12-23 18:44:29 · 78 阅读 · 0 评论 -
struts+spring +jdbctemplate demo
hema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:jsp="http://java.sun.com/xml/ns/javaee/jsp" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.x2015-12-07 11:32:52 · 103 阅读 · 0 评论 -
spring + struts + hibernate demo
LSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">2015-12-07 11:09:18 · 95 阅读 · 0 评论 -
cookie java spring
.servlet.http.HttpServletResponse;public class CookieTool { public static int maxAge = 7* 24 * 60 * 60; //保存7天 public static void addCookie(HttpServletResponse response, String name, String value, int maxAge) { Cookie cookie = new Co2015-06-17 11:14:35 · 73 阅读 · 0 评论 -
spring 动态数据源切换
m.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="${jdbc.driverclass}" /> <property name="jdbcUrl" value="${jdbc.url}" /> <property原创 2015-06-03 09:44:57 · 96 阅读 · 0 评论 -
spring 权限角色管理
licationEvent arg0) { if(arg0 instanceof ContextRefreshedEvent){ List<Right> rights = rs.findAllEntities(); Map<String, Right> map = new HashMap<String, Right>(); for(Right r : rights){ map.put(2015-06-02 15:24:11 · 209 阅读 · 0 评论 -
spring ehcache 缓存管理
切入点通知 --> <aop:advisor advice-ref="cacheAdvice" pointcut="execution(* *..*Service.*(..))" order="0"/> </aop:config> <!-- 缓存管理器 --> <bean id="cacheManag2015-06-02 14:38:39 · 62 阅读 · 0 评论 -
spring log 日志管理
logService ; public Object record(ProceedingJoinPoint pjp){ Log log = new Log(); try { ActionContext ac = ActionContext.getContext(); if(ac != null){ Map<String, Object> session = ac.getSession(); if(session != nul2015-06-02 14:18:01 · 214 阅读 · 0 评论 -
redis 集成到 spring 中
stance" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org2015-05-29 13:47:11 · 66 阅读 · 0 评论 -
mysql 保存 blob 类型数据 乱码 解决
正后 ,即可private byte[] archiveValue; // blob 其他解决方法http://knight-black-bob.iteye.com/blog/2213090 --------------------------------------------------------------------------------------------------------------------------------字符串乱码解决原创 2015-05-20 17:29:52 · 4331 阅读 · 0 评论 -
spring 多数据库 操作
/spring-beans.dtd"><beans> <bean id="config" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> &原创 2015-05-20 17:29:37 · 80 阅读 · 0 评论 -
spring jdbc JdbcTemplate入门
ob_table(id_archive,archive_name,application_id,date_string,date_string_2,archive_type,time_string,archive_value) values (?,?,?,?,?,?,?,?)"; return this.getJdbcTemplate().update( sql, new Object[] {ab.getIdArchive(),ab.getArchiveName(),ab.getApplic原创 2015-05-20 17:29:21 · 64 阅读 · 0 评论 -
spring 定时任务
原创 2015-05-12 11:46:21 · 80 阅读 · 0 评论 -
多数据源 更新 spring jta java jotm
e.com/blog/2212872 大家 可以 感受一下 优缺点……… applicationContext.xml <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http:/2015-06-17 17:23:12 · 72 阅读 · 0 评论 -
(三种方式 获取 properties)自定义PropertyPlaceholderConfigurer 获取properties值 spri
ndle("constants"); return bundle.getString(code); } 第二种方式:<dependency> <groupId>com.typesafe</groupId> <artifactId>config</artifactId> &2015-08-10 12:16:42 · 337 阅读 · 0 评论 -
(可以跑通的,mybatis+springmvc+druid+Atomikos)基于druid ,多数据 spring
text.ContextConfiguration;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;import com.mifi.service.MifiDeviceService;import com.mifidb.service.SysMifiUserAssetsService;@RunWith(SpringJUnit4ClassRunner.class) @ContextCon2015-11-13 17:41:08 · 180 阅读 · 0 评论 -
spring 注解
用于标注业务层组件 @Controller用于标注控制层组件(如struts中的action) @Repository用于标注数据访问组件,即DAO组件. @Component泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注。@Scope(“prototype”)来改变。可以使用以下方式指定初始化方法和销毁方法(方法名任意) 实例解释:该实例是添加@Component 后,spring在base-package扫描 后,执行afterPropertiesSet方法。2015-11-11 16:54:33 · 60 阅读 · 0 评论