当前位置:网站首页>答案在哪里?action config/Interceptor/class/servlet
答案在哪里?action config/Interceptor/class/servlet
2022-07-07 06:33:00 【51CTO】
项目已提测,这两天我们都集中精力梳理外包团队给我司研发的这个三方支付系统的代码逻辑。今天下午爱琴海会议室,开发组里一同学分享他对支付结果回调的梳理成果。
支付结果回调的整体时序是:支付渠道方处理完用户支付信息后,主动调用我方在支付发起时提供的回调地址,把支付结果推给我方,我方处理完成后,回写字符串“ok”以告知支付渠道方,渠道方接收到这个消息,即完成支付结果的通知。
在逻辑的最后抛出了一个疑问。代码见下面截图,即我方经过验签、数据校验、更新订单支付结果、记账、通知下游商户等一系列逻辑处理之后,要回写字符串“ok”。responseString的值即是“ok”。程序直接给edb这个对象set了一个参数,然后程序就return完事了。我们知道,肯定要通过当前HttpServletResponse的getWriter的print()或write()方法把这个文本消息输出到页面上。而在调用这个NotifyServiceIml的Action里也没有这样的语句。那么,疑问来了,看后面的注释“设置此值后,平台会自动返回给通道”,自动返回给渠道方是怎么实现的呢?在哪里实现的呢? 那接下来就是要找到这些代码在哪里了。
首先,哥们儿打开action config文件。看看当后台Action返回处理成功后,对应的jsp里有没有打印。不过,发现没有配置jsp。
那么接下来,自然想到的是Interceptor。定位到这个服务类对应的Interceptor类。通过逐行分析onResponse()方法,也没有发现getWriter()这样的代码行。
奇怪了!有同学提议会后直接问外包的程序员吧,一问便知。我一向喜欢先自己抠代码,实在不行再去问。于是,我接过同事的笔记本电脑,硬着头皮分析这个Service和它的父类的代码,兴许有没有梳理到的代码呢。结果呢,包括我在内,四五双眼睛都没有发现。 我苦笑:“认怂了!”
其实我还是不服输的。去了趟洗手间回到工位,突然想到了servlet。赶紧找servlet-mapping。果然,在web.xml里定义了servlet-mapping;果然,在这个ActionServlet类里,查找getWriter关键字找到了答案。
⁶⁶ ⁶⁶⁶⁶⁶⁶ ⁶⁶66⁶⁶⁶⁶ ₆₆₆₆可以啊.这波 ₆₆₆₆⁶⁶⁶⁶⁶⁶卧槽 ⁶⁶666⁶⁶⁶⁶⁶⁶66⁶⁶⁶⁶ 卧槽⁶⁶⁶⁶⁶⁶ ⁶6666⁶⁶666₆₆₆₆₆ 666 ⁶⁶⁶⁶⁶⁶ 666666₆₆₆₆₆₆ ₆⁶⁶⁶ ⁶⁶⁶⁶⁶⁶ ⁶⁶66⁶⁶⁶⁶ ₆₆₆₆可以啊
边栏推荐
- Locust performance test 2 (interface request)
- How long does the PMP usually need to prepare for the exam in advance?
- Several methods of calculating the average value of two numbers
- C language for calculating the product of two matrices
- Output a spiral matrix C language
- systemd
- Data association between two interfaces of postman
- 徽商期货公司评级是多少?开户安全吗?我想开户,可以吗?
- Goldbach conjecture C language
- Unityshader introduction essentials personal summary -- Basic chapter (I)
猜你喜欢
H3C VXLAN配置
【istio简介、架构、组件】
How to use Arthas to view class variable values
2022-06-30 Unity核心8——模型导入
Ppt template and material download website (pure dry goods, recommended Collection)
STM32 clock system
Locust performance test 3 (high concurrency, parameter correlation, assembly point)
2022-06-30 unity core 8 - model import
On December 8th, 2020, the memory of marketing MRC application suddenly increased, resulting in system oom
端口复用和重映像
随机推荐
Simulation volume leetcode [general] 1609 Parity tree
Common short chain design methods
C语言指针(中篇)
UnityShader入门精要个人总结--基础篇(一)
串口實驗——簡單數據收發
Regularly modify the system time of the computer
Postman data driven
Systick滴答定时器
STM32的时钟系统
E-commerce campaign Guide
【SVN】SVN是什么?怎么使用?
【istio简介、架构、组件】
Pytest+request+allure+excel interface automatic construction from 0 to 1 [five nails / flying Book notice]
Pytest+request+allure+excel interface automatic construction from 0 to 1 [familiar with framework structure]
Cesium load vector data
Why is access to the external network prohibited for internal services of the company?
面试题:高速PCB一般布局、布线原则
Screen automatically generates database documents
How to use Arthas to view class variable values
2022-06-30 Unity核心8——模型导入