----------------------------------------------------------------------------------------------------------------
springboot 详解 (一) helloworld 下载demo
springboot 详解 (四)redis & filter 下载demo
springboot 详解 (五)interceptor 下载demo
springboot 详解 (六)servlet & scheduled & listener 下载demo
springboot 详解(七) dubbox & zookeeper 下载(productor) 下载(constumser)
springboot 详解(八) springboot & springcloud
----------------------------------------------------------------------------------------------------------------
其他文章参考:
(阿里巴巴 dubbo,有数据库,可执行 )dubbo zookeeper spring demo
(webservice+cxf+mybatis+mysql+springmvc) webservice + cxf 能够跑起来的cxf ,来这里,,
结果 如图
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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.curiousby.cn</groupId> <artifactId>SpringBootDubboxDemo</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>SpringBootDubboxDemo Maven Webapp</name> <url>http://maven.apache.org</url> <repositories> <repository> <id>spring-snapshots</id> <url>http://repo.spring.io/libs-snapshot</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>spring-snapshots</id> <url>http://repo.spring.io/libs-snapshot</url> </pluginRepository> </pluginRepositories> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.7</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-redis</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>dubbo</artifactId> <version>2.5.3</version> <exclusions> <exclusion> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.zookeeper</groupId> <artifactId>zookeeper</artifactId> <version>3.4.6</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.github.sgroschupf</groupId> <artifactId>zkclient</artifactId> <version>0.1</version> </dependency> </dependencies> <build> <finalName>SpringBootDubboxDemo</finalName> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <useSystemClassLoader>false</useSystemClassLoader> </configuration> </plugin> </plugins> </build> </project>
SpringBootDubboxDemo-Productor
application.properties
server.context-path=/SpringBootDubboxDemoProductor spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp application.hello=Hello baoyou #one datasource spring.datasource.url=jdbc:mysql://localhost:3306/database spring.datasource.username=root spring.datasource.password=root spring.datasource.driverClassName=com.mysql.jdbc.Driver
applicationContext-dubbox-productor.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:cache="http://www.springframework.org/schema/cache" xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:lang="http://www.springframework.org/schema/lang" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:p="http://www.springframework.org/schema/p" xmlns:task="http://www.springframework.org/schema/task" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd" default-autowire="byName"> <context:annotation-config /> <aop:aspectj-autoproxy /> <!-- 提供方应用名称信息,这个相当于起一个名字,我们dubbo管理页面比较清晰是哪个应用暴露出来的 --> <dubbo:application name="dubbox-productor"></dubbo:application> <!--使用注解方式暴露接口 --> <!--<dubbo:annotation package="com.curiousby.cn.service" /> --> <!-- 使用zookeeper注册中心暴露服务地址 --> <dubbo:registry address="zookeeper://dev10.aoiplus.openpf:2181" check="false" subscribe="false" register=""> </dubbo:registry> <!-- 要暴露的服务接口 --> <dubbo:service interface="com.curiousby.cn.service.UserService" ref="userServiceImpl" /> </beans>
public interface UserService { public User findById(int userId); }
@Transactional @Service public class UserServiceImpl implements UserService { @Resource UserDao userDao; @Override public User findById(int userId) { System.out.println("================productor==================="); User user = userDao.findById(userId); System.out.println("================productor==================="+user); return user; } }
@EnableTransactionManagement //事务自动扫描 @SpringBootApplication @ImportResource({"classpath:applicationContext-dubbox-productor.xml"}) public class SpringBootSampleApplication { public static void main(String[] args) { SpringApplication.run(SpringBootSampleApplication.class, args); } }
SpringBootDubboxDemo-Consumer
server.context-path=/SpringBootDubboxDemoConsumer spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp application.hello=Hello baoyou #one datasource spring.datasource.url=jdbc:mysql://localhost:3306/database spring.datasource.username=root spring.datasource.password=root spring.datasource.driverClassName=com.mysql.jdbc.Driver server.port=9090 server.session-timeout=60 # server.address=192.168.16.11
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> <!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 --> <dubbo:application name="dubbox-consumer" /> <dubbo:registry address="zookeeper://dev10.aoiplus.openpf:2181" /> <!-- 生成远程服务代理,可以和本地bean一样使用demoService --> <dubbo:reference id="userService" interface="com.curiousby.cn.service.UserService" /> </beans>
@EnableTransactionManagement //事务自动扫描 @SpringBootApplication @ImportResource({"classpath:applicationContext-dubbox-consumer.xml"}) public class SpringBootSampleApplication { public static void main(String[] args) { SpringApplication.run(SpringBootSampleApplication.class, args); } }
捐助开发者
在兴趣的驱动下,写一个免费
的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!
相关推荐
确保配置了OpenCV、OpenMP(如果是GCC则无需配置)。 初次运行时,可建立 build 文件夹,并执行如下命令。测试图片及边缘检测结果图均位于 ./pics 下。 mkdir build cd build cmake .. make -j16 cd .. ./build/sobel ./pics/test.png 通过修改 CMakeLists.txt 下 set(USE_OMP ON) 的 ON/OFF ,并重新编译,即可启用/不启用OpenMP进行加速计算。实际测试加速效果不明显。 运行用时可能与目前CPU运行状态有关
基于PySide2实现后台管理界面
java-springboot+vue教学资料管理系统实现源码(完整前后端+mysql+说明文档+LunW).zip
SSM架构 +Nginx+FFmpeg实现rtsp流转hls流,在前端html上实现视频播放 (包含内容有:FFmpeg安装包、Nginx安装包、SSM架构包、playerJQueryDemo网页) 适合小白+想进行实时预览的朋友,本人亲测可行
物联网实战项目
物联网实战项目
ad7616_driver.v
windows运行库
威纶触摸屏程序实践指南:UI界面复制与适配,适用于EB Pro6.00以上版本,4.3寸、7寸、10寸屏幕通用,威纶触摸屏程序实践指南:UI界面复制与适配,适用于EB Pro6.00以上版本,4.3寸、7寸、10寸屏幕通用,维纶触摸屏程序实际项目,威纶通界面UI,复制可用,威伦通触摸EB Pro6.00以上版本均可用,ip和ie系列4.3寸7寸10寸均复制可用电子档 ,核心关键词:维纶触摸屏程序; 威纶通界面UI; 复制可用; 威伦通触摸屏; EB Pro6.00以上版本; 兼容IP和IE系列; 4.3寸7寸10寸均可用; 电子档,维纶触摸屏项目UI复制方案,多尺寸屏幕适配通用电子档
端口监控器
基于OpenCv和人脸识别技术
java-springboot+vue海滨体育馆管理系统设计与实现源码(完整前后端+mysql+说明文档+LunW).zip
毕业答辩创意开题报告论文答辩模板 (1).pptx
LabVIEW编程四通道示波器源程序详解:实现方法与功能解析,LabVIEW编程四通道示波器源程序详解:实现方法与功能解析,labVIEW编程的四通道示波器源程序 ,核心关键词:LabVIEW编程; 四通道示波器; 源程序; 信号处理; 数据采集,LabVIEW编程四通道示波器源程序开发指南
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
Manus演示案例
物联网实战项目
《基于遗传算法优化BP神经网络的数据分类预测: MATLAB代码实现》,基于遗传算法优化的BP神经网络(GA-BP)在数据分类预测中的应用及Matlab实现,基于遗传算法优化BP神经网络(GA-BP)的数据分类预测 matlab代码 ,核心关键词:遗传算法; BP神经网络; 数据分类预测; MATLAB代码; GA-BP模型。,基于GA-BP算法的遗传优化BP神经网络Matlab代码实现数据分类预测
智慧物流核心痛点与DeepSeek解决方案矩阵
粒子群算法在储能容量优化配置中的应用:成本模型构建与最优运行计划求解,粒子群算法在储能容量优化配置中的应用:成本模型分析与最优运行计划求解,粒子群算法储能容量优化配置,有三篇参考。 物有所值 关键词:储能优化配置 粒子群 储能充放电优化 主要内容:建立了储能的成本模型,包含运行维护成本以及容量配置成本,然后以该成本函数最小为目标函数,经过粒子群算法求解出其最优运行计划,并通过其运行计划最终确定储能容量配置的大小,求解采用的是PSO算法(粒子群算法),求解效果极佳, ,关键词:储能优化配置; 粒子群算法; 储能成本模型; 运行维护成本; 容量配置成本; 充放电优化; 运行计划; 容量配置大小; PSO算法。,基于粒子群算法的储能容量优化配置及充放电策略研究