package com.dh.activiti;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; public class ProcessInterceptor implements HandlerInterceptor { @Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception { httpServletResponse.setHeader("Access-Control-Allow-Origin", "*"); httpServletResponse.setHeader("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With"); httpServletResponse.setHeader("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS"); httpServletResponse.setHeader("X-Powered-By","Jetty"); String method= httpServletRequest.getMethod(); if (method.equals("OPTIONS")){
httpServletResponse.setStatus(200);
return false;
} System.out.println(method); return true;
} @Override
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception { } @Override
public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception { }
}

  

package com.dh.activiti;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter { @Bean //把我们的拦截器注入为bean
public HandlerInterceptor getMyInterceptor(){
return new ProcessInterceptor();
} @Override
public void addInterceptors(InterceptorRegistry registry) {
// addPathPatterns 用于添加拦截规则, 这里假设拦截 /url 后面的全部链接
// excludePathPatterns 用户排除拦截
registry.addInterceptor(getMyInterceptor()).addPathPatterns("/**");
super.addInterceptors(registry);
}
}

  

package com.dh.activiti;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; @Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter { @Bean //把我们的拦截器注入为bean
public HandlerInterceptor getMyInterceptor(){
return new ProcessInterceptor();
} @Override
public void addInterceptors(InterceptorRegistry registry) {
// addPathPatterns 用于添加拦截规则, 这里假设拦截 /url 后面的全部链接
// excludePathPatterns 用户排除拦截
registry.addInterceptor(getMyInterceptor()).addPathPatterns("/**");
super.addInterceptors(registry);
}
}

  

package com.dh.activiti;

import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletResponse;
import java.util.Map; /**
* Created by Administrator on 2018/6/17.
*/
@RestController
public class ActivityConsumerServiceImpl { @RequestMapping(value = "/startActivityDemo", method = RequestMethod.POST)
public boolean startActivityDemo(@RequestBody Map<String,Object> map, HttpServletResponse response) {
// response.setHeader("Access-Control-Allow-Origin","127.0.0.1:8020");
System.out.println(JSON.toJSONString(map));
TestEntity testEntity = JSON.parseObject(JSON.toJSONString(map),TestEntity.class);
System.out.println(JSON.toJSONString(testEntity));
return false;
} }

  

bl bl bl bl bl的更多相关文章

  1. 汇编指令-位置无关码(BL)与绝对位置码(LDR)(2)

    位置无关码,即该段代码无论放在内存的哪个地址,都能正确运行.究其原因,是因为代码里没有使用绝对地址,都是相对地址.  位置相关码,即它的地址与代码处于的位置相关,是绝对地址 BL :带链接分支跳转指令 ...

  2. 科普一下bl锁的知识,没解锁的必看!

    今天给大家科普一下. 科普分为两版,一个详细版一个简单版.简单版往下翻. bl是什么?其实详细的我也不知道,我就知道原理和他的全称是bootloader.我们所说的解锁里面的“锁”,就是blbl锁的功 ...

  3. windbg-bp、 bm、 bu、 bl、 bc、 ba(断点、硬件断点)

    bp bp 命令是在某个地址下断点, 可以 bp 0x7783FEB 也可以 bp MyApp!SomeFunction . 对于后者,WinDBG 会自动找到MyApp!SomeFunction 对 ...

  4. 使用B或BL跳转时,下一条指令的地址是这样计算的

    B跳转指令:它是个相对跳转指令,其机器码格式如下: [31:28]位是条件码:[27:24]位为“1010”(0xeaffffff)时,表示B跳转指令,为“1011”时,表示BL跳转指令:[23:0] ...

  5. PIT,BL,AP,CP,CSC

    使用ODIN刷机的时候,要选择ROM文件,以下是5件套各部分的说明: PIT:分区信息,如果没有更换ROM,一般不需要刷,也不需要勾选re-partition选项 BL:bootloader,引导信息 ...

  6. 谷歌pixel手机解BL锁、刷机、破解电信(史上最详细的帖子)

    本文根据网上已有内容进行整理,对每一个步骤都进行了实践,运气爆棚,几乎没有出现什么重大错误,小错误也进行了很好地解决.因此,十分感激那些为折腾google pixel的IT爱好者,为我提供了无穷的帮助 ...

  7. Windbg命令学习15(bp bm bu bl bc ba断点)

    以下以skinhgy为例,windbg附加运行 1. bp 命令是在某个地址下断点, 可以 bp 0x7783FEB 也可以 bp MyApp!SomeFunction . 对于后者,WinDBG 会 ...

  8. S3C2440的七种模式之——未定义模式(去掉bl print1 bug解决)

    现在做第一个实验,模拟未定义模式. 未定义模式,是cpu遇到自己不能识别的指令时候做出的异常处理. arm指令的机器码一定是按照某种规范要求的,不然你随意写一条指令,cpu不是都可以执行吗?在cpu没 ...

  9. 关于ARM的B,BL跳转指令

    .text:00001260 A3 04 00 EB                             BL      sub_24F4 当前地址+ (偏移 << 2 + 8) =  ...

  10. arm B和BL指令浅析

    arm B和BL指令浅析 B或BL指令引起处理器转移到“子程序名”处开始执行.两者的不同之处在于:(1)BL指令在转移到子程序执行之前,将其下一条指令的地址拷贝到R14(LR,链接寄存器).      ...

随机推荐

  1. 如何通过审计安全事件日志检测密码喷洒(Password Spraying)攻击

    许多渗透测试人员和攻击者通常都会使用一种被称为“密码喷洒(Password Spraying)”的技术来进行测试和攻击.对密码进行喷洒式的攻击,这个叫法很形象,因为它属于自动化密码猜测的一种.这种针对 ...

  2. 【非原创】ISBN码

    #include<stdio.h>int main(void){ char a[14],mod[12]="0123456789X"; #include <stdi ...

  3. 加法变乘法——第六届蓝桥杯C语言B组(省赛)第六题

    原创 加法变乘法 我们都知道:1+2+3+ ... + 49 = 1225现在要求你把其中两个不相邻的加号变成乘号,使得结果为2015 比如:1+2+3+...+10*11+12+...+27*28+ ...

  4. Python学习之——Python安装

    环境:Centos6.5+python2.7.5 1.centons6.5系统中是已经安装了python的,先查看版本是不是需要的 python --version 2.安装一些必要的包,防止后面需要 ...

  5. 项目开发设计模式理解之MVC模式

    项目开发设计模式之MVC模式: M model 模型层 V view 视图层 C control 控制器 MVC模式在B/S架构下使用很广泛的软件设计模式,分成三个相对独立的模块构成,model+vi ...

  6. 20155302 2016-2017-2 《Java程序设计》第4周总结

    20155302 2016-2017-2 <Java程序设计>第4周学习总结 教材学习内容总结 有关类的继承的理解:类实现继承的格式:class 子类名 extends 父类名 类的继承有 ...

  7. 20155331 2016-2017-2《Java程序设计》课程总结

    20155331 2016-2017-2<Java程序设计>课程总结 每周作业 预备作业1:新学期,新展望 预备作业2:游戏经验 第一周学习总结:大致浏览教材并提出问题 第二周学习总结:基 ...

  8. GridView中加入//实现分页

    要在GridView中加入//实现分页 AllowPaging="true" PageSize="10" // 分页时触发的事件 protectedvoid g ...

  9. CF 1083 B. The Fair Nut and Strings

    B. The Fair Nut and Strings 题目链接 题意: 在给定的字符串a和字符串b中找到最多k个字符串,使得不同的前缀字符串的数量最多. 分析:  建出trie树,给定的两个字符串就 ...

  10. LVS入门篇(三)之LVS的工作模式和调度算法

    1.NAT模型 (1)原理图: ①.客户端(200.10.10.1)将请求发往前端的负载均衡器(114.100.80.10),请求报文源地址是CIP(客户端IP),后面统称为CIP),目标地址为VIP ...