当前位置:网站首页>答案在哪里?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⁶⁶⁶⁶ ₆₆₆₆可以啊
边栏推荐
- MySQL master-slave delay solution
- MySQL common statements
- 2022-06-30 Unity核心8——模型导入
- Analysis of Hessian serialization principle
- How can I apply for a PMP certificate?
- Screen automatically generates database documents
- C语言指针(中篇)
- Original collection of hardware bear (updated on May 2022)
- RuntimeError: Calculated padded input size per channel: (1 x 1). Kernel size: (5 x 5). Kernel size c
- Output a spiral matrix C language
猜你喜欢

MySQL common statements

Reading notes of pyramid principle

Synchronized underlying principle, volatile keyword analysis

Serial port experiment - simple data sending and receiving

PMP Exam details after the release of the new exam outline

What is the use of PMP certificate?

Locust performance test 5 (analysis)

Two schemes of unit test

Three updates to build applications for different types of devices | 2022 i/o key review

2020 year end summary
随机推荐
MySql数据库-事务-学习笔记
模拟卷Leetcode【普通】1567. 乘积为正数的最长子数组长度
Led analog and digital dimming
Original collection of hardware bear (updated on June 2022)
Cesium does not support 4490 problem solution and cesium modified source code packaging scheme
Pycharm importing third-party libraries
What is the value of getting a PMP certificate?
Analysis of Hessian serialization principle
2022-06-30 Unity核心8——模型导入
2021 year end summary
What are the suggestions for PMP candidates?
C language pointer (special article)
Panel display technology: LCD and OLED
Screen automatically generates database documents
[chaosblade: node CPU load, node network delay, node network packet loss, node domain name access exception]
PMP Exam Preparation experience, seek common ground while reserving differences, and successfully pass the exam
External interrupt to realize key experiment
Postman setting environment variables
串口实验——简单数据收发
MySql数据库-索引-学习笔记