当前位置:网站首页>答案在哪里?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⁶⁶⁶⁶ ₆₆₆₆可以啊
边栏推荐
猜你喜欢

【SVN】SVN是什么?怎么使用?

Skill review of test engineer before interview

STM32串口寄存器库函数配置方法

Storage of data in memory

2022-06-30 unity core 8 - model import

Output a spiral matrix C language

MySql数据库-事务-学习笔记

H3C vxlan configuration

Screen automatically generates database documents

【Istio Network CRD VirtualService、Envoyfilter】
随机推荐
Simulation volume leetcode [general] 1557 The minimum number of points that can reach all points
Entity of cesium data visualization (Part 1)
systemd
Postman interface test (I. installation and use)
Screen automatically generates database documents
External interrupt to realize key experiment
STM32的时钟系统
Troublesome problem of image resizing when using typora to edit markdown to upload CSDN
PMP Exam Preparation experience systematically improve project management knowledge through learning
Personal deduction topic classification record
Simulation volume leetcode [general] 1609 Parity tree
Interpretation of MySQL optimization principle
MySql数据库-事务-学习笔记
Upgrade Alibaba cloud RDS (relational database service) instance to com mysql. jdbc. exceptions. Troubleshooting of jdbc4.communicationsexception
OpenGL 3D graphics rendering
Interview question: general layout and wiring principles of high-speed PCB
Serializer & modelserializer of DRF serialization and deserialization
Output a spiral matrix C language
Ppt template and material download website (pure dry goods, recommended Collection)
Cesium does not support 4490 problem solution and cesium modified source code packaging scheme