SpringMVC Mybatis Shiro RestTemplate的实现客户端无状态验证及访问控制【转】

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

A.首先需要搭建SpringMVC+Shiro环境

a1.pom.xml配置
 spring:

<dependency>

 <groupId>org.springframework</groupId>

<artifactId>spring-webmvc</artifactId><version>4.1.0.RELEASE</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-aop</artifactId><version>4.1.0.RELEASE</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-jdbc</artifactId><version>4.1.0.RELEASE</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-context-support</artifactId><version>4.1.0.RELEASE</version>
</dependency>
<dependency><groupId>org.aspectj</groupId><artifactId>aspectjweaver</artifactId><version>1.8.7</version>
</dependency>

 Mybatis:

<dependency><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId><version>3.3.0</version>
</dependency>
<dependency><groupId>org.mybatis</groupId><artifactId>mybatis-spring</artifactId><version>1.2.3</version>
</dependency>
<dependency><groupId>jdbc.driver</groupId><artifactId>oracle.n</artifactId><version>12.1.0.1.RELEASE</version>
</dependency>
<dependency><groupId>c3p0</groupId><artifactId>c3p0</artifactId><version>0.9.1.2</version>
</dependency>

JSON转换,Bean转换,加密,文件上传,日志记录等相关工具:

<dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-core</artifactId><version>2.6.3</version>
</dependency>
<dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.6.3</version>
</dependency>
<dependency><groupId>net.sf.json-lib</groupId><artifactId>json-lib</artifactId><version>2.2.2-jdk15</version>
</dependency>
<dependency><groupId>net.sf.ezmorph</groupId><artifactId>ezmorph</artifactId><version>1.0.6</version>
</dependency>
<dependency><groupId>commons-codec</groupId><artifactId>commons-codec</artifactId><version>1.9</version>
</dependency>
<dependency><groupId>commons-beanutils</groupId><artifactId>commons-beanutils</artifactId><version>1.7.0</version>
</dependency>
<dependency><groupId>commons-collections</groupId><artifactId>commons-collections</artifactId><version>3.2</version>
</dependency>
<dependency><groupId>commons-lang</groupId><artifactId>commons-lang</artifactId><version>2.4</version>
</dependency>
<dependency><groupId>commons-fileupload</groupId><artifactId>commons-fileupload</artifactId><version>1.3.1</version>
</dependency>
<dependency><groupId>org.slf4j</groupId><artifactId>slf4j-log4j12</artifactId><version>1.7.7</version>
</dependency>

shiro:

<dependency><groupId>org.apache.shiro</groupId><artifactId>shiro-core</artifactId><version>1.2.2</version>
</dependency>
<dependency><groupId>org.apache.shiro</groupId><artifactId>shiro-web</artifactId><version>1.2.2</version>
</dependency>
<dependency><groupId>org.apache.shiro</groupId><artifactId>shiro-spring</artifactId><version>1.2.2</version>
</dependency>

a2.web.xml配置

 

<!-- 定义应用在Spring容器中的全局标志,避免冲突 -->
<context-param><param-name>webAppRootKey</param-name><param-value>reedws</param-value>
</context-param>
<!-- 配置SpringMVC入口 -->
<servlet><servlet-name>mvc</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:spring/spring-mvc.xml</param-value></init-param><load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping><servlet-name>mvc</servlet-name><url-pattern>/</url-pattern>
</servlet-mapping><!-- 加载log4j配置文件 -->
<context-param><param-name>log4jConfigLocation</param-name><param-value>classpath:log4j.properties</param-value>
</context-param>
<listener><listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener><!-- 配置Spring业务层,shiro相关配置就处于业务层 -->
<context-param><param-name>contextConfigLocation</param-name><param-value>classpath:spring/spring-mybatis.xml,classpath:spring/spring-service.xml,classpath:spring/spring-shiro.xml</param-value>
</context-param>
<listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener><!-- 配置Spring自带的Web应用生命周期管理器 -->
<listener><listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener><!-- 配置全局编码,和项目编码一致即可,此处用GBK,建议用UTF-8 -->
<filter><filter-name>encoding</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>GBK</param-value></init-param>
</filter>
<filter-mapping><filter-name>encoding</filter-name><url-pattern>/*</url-pattern>
</filter-mapping><!-- 和shiro整合,通过过滤器代理配置shiro的过滤器 -->
<filter><filter-name>shiroFilter</filter-name><filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class><init-param><param-name>targetFilterLifecycle</param-name><param-value>true</param-value></init-param>
</filter>
<filter-mapping><filter-name>shiroFilter</filter-name><url-pattern>/*</url-pattern>
</filter-m
 

核心技术:Maven,Springmvc mybatis shiro, Druid, Restful, 

Dubbo, ZooKeeper,Redis,FastDFS,ActiveMQ,Nginx 
1.     项目核心代码结构截图

分布式框架介绍 - kafkaee - kafkaee的博客

   项目模块依赖

分布式框架介绍 - kafkaee - kafkaee的博客

 

特别提醒:开发人员在开发的时候可以将自己的业务REST服务化或者Dubbo服务化

2.    项目依赖介绍

   2.1 后台管理系统、Rest服务系统、Scheculer定时调度系统依赖如下图:

 

分布式框架介绍 - kafkaee - kafkaee的博客

       2.2 Dubbo独立服务项目依赖如下图:

 分布式框架介绍 - kafkaee - kafkaee的博客

3.  项目功能部分截图:

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客
 

zookeeper、dubbo服务启动 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客
 

dubbo管控台 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 REST服务平台

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

 

分布式框架介绍 - kafkaee - kafkaee的博客

转载于:https://my.oschina.net/bngkjdnhfkjg/blog/755709

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/542443.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

sql服务器默认密码_搭建一个DNS服务器,轻松实现域名解析内容分发,访问速度提高N倍...

DNS服务器&#xff0c;Domain Name Server&#xff0c;域名解析服务器&#xff0c;互联网上相互通信使用的是IP&#xff0c;但是IP是又长又臭又难记&#xff0c;所以创造了域名来解决IP难写难记的问题&#xff0c;记一个g.cn比203.208.50.127强过不知多少倍了。有了域名&#x…

在C ++ STL中使用string :: to_string()将数字转换为字符串

to_string() is a library function of <string> header, it is used to convert numeric value (number) to string. to_string()是<string>标头的库函数&#xff0c;用于将数值(数字)转换为字符串。 Syntax: 句法&#xff1a; string to_string(numberic_value…

门级建模

学习目标 学习Verilog提供的门级原语 理解门的实例引用、门的符号以及and/or&#xff0c;buf/not类型的门的真值表 学习如何根据电路的罗技图来生成Verilog描述 讲述门级设计中的上升、下降和关断延迟 解释门级设计中的最小、最大和典型延迟 1.门的类型 1.1与门&#xff08;and…

linux .net 控制台应用程序,VisualStudioCode创建的asp.net core控制台程序部署到linux

1、asp.net core控制台程序static void Main(string[] args){int times10;while(times>0){Console.WriteLine("Hello World!");times--;Thread.Sleep(1000);}}2、发布发布前&#xff0c;修改test2.csproj文件(项目名称为test2)Exenetcoreapp2.1centos.7-x64主要添…

数组长度属性以及JavaScript中的示例

JavaScript长度属性 (JavaScript length property) length property is used to get and set the length of an array in JavaScript. length属性用于获取和设置JavaScript中数组的长度。 Syntax to get the length of an array: 获取数组长度的语法&#xff1a; array_name.…

怎么挖linux内核的漏洞,linux内核漏洞分析实战看看专家是怎么一步步...-卓优商学院问答...

推荐回答Linux内核调试方法kdb&#xff1a;只能在汇编代码级进行调试&#xff1b;优点是不需要两台机器进行调试。gdb&#xff1a;在调试模块时缺少一些至关重要的功能&#xff0c;它可用来查看内核的运行情况&#xff0c;包括反汇编内核函数。kgdb&#xff1a;能很方便的在源码…

COGS182 [USACO Jan07] 均衡队形[RMQ]

182. [USACO Jan07] 均衡队形 ★★ 输入文件&#xff1a;lineup.in 输出文件&#xff1a;lineup.out 简单对比时间限制&#xff1a;4 s 内存限制&#xff1a;128 MB 题目描述 农夫约翰的 N (1 ≤ N ≤ 50,000) 头奶牛&#xff0c;每天挤奶时总会按同样的顺序站好。一日…

string中concat_JavaScript中带示例的String concat()方法

string中concat字符串concat()方法 (String concat() Method) concat() is a string method in JavaScript, it is used to concatenate (join) two or more strings and returns a new joined string. concat()是JavaScript中的字符串方法&#xff0c;用于连接(联接)两个或多个…

linux全自动备份网站到百度云盘,Linux定时备份数据到百度云盘(示例代码)

导读&#xff1a;如今的百度云盘免费容量都是2T了&#xff0c;即使把电脑上所有的东东都放上去&#xff0c;也还有大把的剩余空间。对于站长来说&#xff0c;是完全可以充分利用这些硬盘空间的&#xff0c;现在我们就用百度云盘来备份Linux服务器上的数据。一直在想&#xff0c…

python dict底层实现_dict实现原理和哈希表

dict底层实现在Python中&#xff0c;字典是依靠散列表或说哈希表(Hash Table)进行实现的&#xff0c;使用开放地址法解决冲突。所以其查找的时间复杂度会是O(1)&#xff0c;下文会具体讲解哈希表的工作原理和解决冲突时的具体方法。也就是说&#xff0c;字典也是一个数组&#…

网际控制报文协议icmp_网络中的ICMP(Internet控制消息协议)

网际控制报文协议icmpICMP(Internet控制消息协议)简介 (Introduction to ICMP (Internet Control Message Protocol)) IP (Internet Protocol) is a network layer protocol. The responsibility of delivering data (Logical Addressing) to any network is done by the IP (I…

谈色

最近很苦恼&#xff0c;像是到了男人的生理期&#xff0c;或者说是类似动物的发情期&#xff0c;见到露长腿的女人总喜欢看。 其实我是并不喜欢这样盯着看&#xff0c;或许是男人的本色&#xff0c;十个男人九个色的本性&#xff0c;总是会不自觉的去偷看&#xff0c;更有甚者还…

linux系统怎样写单片机程序,单片机知识是Linux驱动开发的基础之一以及如何学单片机...

这是arm裸机1期加强版第1课第2、3节课程的wiki文字版。为什么没前途也要学习单片机&#xff1f;因为它是个很好的入口。学习单片机可以让我们抛开复杂的软件结构&#xff0c;先掌握硬件操作&#xff0c;如&#xff1a;看原理图、芯片手册、写程序操作寄存器等。在上一节视频里&…

python教程循环语句_Python教程:关于Python 循环语句

Python 循环语句本章节将向大家介绍Python的循环语句&#xff0c;程序在一般情况下是按顺序执行的。编程语言提供了各种控制结构&#xff0c;允许更复杂的执行路径。循环语句允许我们执行一个语句或语句组多次&#xff0c;下面是在大多数编程语言中的循环语句的一般形式&#x…

math.pow int_Java Math类static int min(int i1,int i2)与示例

math.pow int数学类静态int min(int i1&#xff0c;int i2) (Math Class static int min(int i1 , int i2) ) This method is available in java.lang package. 此方法在java.lang包中可用。 This method is used to return the minimum one of both the given arguments or in…

bat 批处理 常用命令和乱码问题

为什么80%的码农都做不了架构师&#xff1f;>>> rem echo off ECHO OFF XCOPY E:\test.bat D:\ IF ERRORLEVEL 1 ECHO 文件拷贝Failure IF ERRORLEVEL 0 ECHO 文件拷贝Success :start set /p first"1记事本,2远程:" if %first% LEQ 2 (IF %first% …

SuperMap iServer发布的ArcGIS REST 地图服务如何通过ArcGIS API加载

作者&#xff1a;yx 文章目录 一、发布服务二、代码加载三、结果展示 一、发布服务 SuperMap iServer支持将地图发布为ArcGIS REST地图服务&#xff0c;您可以在发布服务时直接勾选ArcGIS REST地图服务&#xff0c;如下图所示&#xff1a; 也可以在已发布的地图服务中&#x…

c语言中的运算符及其含义_按位运算符及其在C语言中与Example一起使用

c语言中的运算符及其含义1)&#xff06;(按位与) (1) & (bitwise AND)) It does AND on every bit of two numbers. The result of AND is 1 only if both bits are 1. 它对两个数字的每一位进行“与”运算。 仅当两个位均为1时&#xff0c;AND的结果才为1。 Example: 例&…

能上网的Linux系统,那一款linux能上网

zhoushao12 于 2009-02-24 19:13:07发表:linux日常使用中,最重要的就是网络(本人觉得)特别时ubuntu .但是现在电信偏偏搞什么账号加密要用互联星空软件才可以拨号,更可恶的是这X软件只有Windws版的!! 使得在linux下拨号上网变得十分麻烦!在网上找了很久终于找到解决方法!!下面拿…