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. Executors 挖坑

    Executors 挖坑 线程频繁的创建销毁是有代价的,所以Java为我们提供了线程池 线程池构造方法很多 我们一般使用Executors的工厂方法: public static ExecutorSe ...

  2. 5.18-笨办法学python-习题16(write)

    from sys import argv script,filename=argv #固定模式啦 print("we're going to erase %r."%filename ...

  3. TCP交互流程

    前言:在FPGA上实现TCP协议实际是一个不太好的计划,因为FPGA最擅长的是流水线处理方式,而TCP存在交互,导致FPGA需要进行反馈式的处理.但是由于项目新增的附加要求而又只能在FPGA上去实现T ...

  4. 20155235 2016-2017-2《Java程序设计》课程总结

    每周作业链接汇总 预备作业一:学期前作业 预备作业二:技能获取与C语言学习情况 预备作业三:安装虚拟机与Linux的学习 第一周作业:20155235 2006-2007-2 <Java程序设计 ...

  5. 15、Java并发编程:Callable、Future和FutureTask

    Java并发编程:Callable.Future和FutureTask 在前面的文章中我们讲述了创建线程的2种方式,一种是直接继承Thread,另外一种就是实现Runnable接口. 这2种方式都有一 ...

  6. mysql数据库 root密码重置

    问题 忘记了MySQL的密码,网上搜索的杂七杂八,汇总一下. mysql版本是windows的mysql 5.7 步骤 1.以管理员身份打开cmd,切换到MySQL的bin目录 默认的话,一般是在C: ...

  7. 常用SQL语句大全(SQL Server)

    一.基础       查看数据库状态 select state_desc from sys.databases where name='dbname'  -- dbname数据库名 1.说明:创建数据 ...

  8. Vue学习计划基础笔记(五) - 表单输入绑定、组件基础

    表单输入绑定.组件基础 目标: 熟练掌握vue中表单的处理方式 对之前学习的内容简单回顾一下,并写一个实例,学以致用(最好脱离文档) vue中表单的处理方式 vue中表单的处理使用了v-model指令 ...

  9. 美国末日AI System设计分享

    引言 好久没有写博客了,这半年在游戏公司工作,过得比较充实,每天不是add feature就是debug,所以忽视了写博客.今天发一篇关于AI博客. 主要是最近看了一些关于"The Last ...

  10. 【转】AOE机制的DSL及其实际运用

    AOE这个词的意思,我相信玩过WOW的人都不陌生,包括玩过LoL的也不会陌生,说穿了就是一个区域内发生效果(Area of effect).这里我们要讨论的就是关于一个适合于几乎所有游戏的AOE机制, ...