当前位置:网站首页>Where is the answer? action config/Interceptor/class/servlet
Where is the answer? action config/Interceptor/class/servlet
2022-07-07 09:19:00 【51CTO】
The project has been tested , In these two days, we have focused on sorting out the code logic of the tripartite payment system developed by the outsourcing team for our company . This afternoon, the Aegean conference room , A student in the development group shared his sorting results of payment result callback .
The overall timing of the payment result callback is : After the payment channel has processed the user's payment information , Actively call the callback address provided by us when the payment is initiated , Push the payment result to us , After our treatment , Write back the string “ok” To inform the payment channel , The channel received this message , Notice of completion of payment results .
At the end of logic, a question is thrown . See the screenshot below for the code , That is, our signature has been verified 、 data verification 、 Update order payment results 、 Bookkeeping 、 Notify downstream merchants and wait for a series of logical processing , To write back a string “ok”.responseString The value of is “ok”. The program directly gives edb This object set A parameter , Then the program return Done. . We know , We must pass the current HttpServletResponse Of getWriter Of print() or write() Method to output this text message to the page . While calling this NotifyServiceIml Of Action There is no such sentence in . that , Here comes the question , Look at the notes below “ After setting this value , The platform will automatically return to the channel ”, How is automatic return to the channel realized ? Where is it implemented ? Then the next step is to find out where these codes are .

First , Brother, open action config file . Look at the backstage Action After successful processing , Corresponding jsp Is there any print in . however , Found no configuration jsp.

So next , Naturally, I think of Interceptor. Locate the corresponding Interceptor class . Through line by line analysis onResponse() Method , And I didn't find out getWriter() Such lines of code .

Strange ! Some students suggested asking the outsourcing programmers directly after the meeting , You can tell by asking . I always like to dig the code first , I really can't ask again . therefore , I took over my colleague's laptop , Harden your head to analyze this Service And the code of its parent class , Maybe there's some sort of code . The result? , Including me , Four or five pairs of eyes did not find . I smile bitterly :“ Yes. !”
In fact, I still admit defeat . Went to the bathroom and returned to the station , Suddenly it occurred to me servlet. Hurry to find servlet-mapping. Sure enough , stay web.xml It's defined in servlet-mapping; Sure enough , In this ActionServlet In class , lookup getWriter The key word found the answer .


⁶⁶ ⁶⁶⁶⁶⁶⁶ ⁶⁶66⁶⁶⁶⁶ ₆₆₆₆ B: yes, you can . This wave of ₆₆₆₆⁶⁶⁶⁶⁶⁶ Oh my god ⁶⁶666⁶⁶⁶⁶⁶⁶66⁶⁶⁶⁶ Oh my god ⁶⁶⁶⁶⁶⁶ ⁶6666⁶⁶666₆₆₆₆₆ 666 ⁶⁶⁶⁶⁶⁶ 666666₆₆₆₆₆₆ ₆⁶⁶⁶ ⁶⁶⁶⁶⁶⁶ ⁶⁶66⁶⁶⁶⁶ ₆₆₆₆ B: yes, you can
边栏推荐
- 【Istio Network CRD VirtualService、Envoyfilter】
- Mysql database transaction learning notes
- C语言指针(上篇)
- PMP experience learning and sharing process
- LeetCode每日一题(2316. Count Unreachable Pairs of Nodes in an Undirected Graph)
- Do you have any certificates with high gold content?
- Reading notes of pyramid principle
- Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
- RuntimeError: Calculated padded input size per channel: (1 x 1). Kernel size: (5 x 5). Kernel size c
- Mysql数据库-锁-学习笔记
猜你喜欢
![Pytest+request+allure+excel interface automatic construction from 0 to 1 [familiar with framework structure]](/img/33/9fde4bce4866b988dd2393a665a48c.jpg)
Pytest+request+allure+excel interface automatic construction from 0 to 1 [familiar with framework structure]

C语言指针(上篇)

Mysql database lock learning notes

Synchronized underlying principle, volatile keyword analysis

H3C vxlan configuration

Several stages of PMP preparation study

Sublime Text4 download the view in bower and set the shortcut key

How to use Arthas to view class variable values

Jemter operation

2020 year end summary
随机推荐
Two schemes of unit test
Entity of cesium data visualization (Part 1)
Postman interface test (II. Set global variables \ sets)
Original collection of hardware bear (updated on May 2022)
Jenkins task grouping
What is the value of getting a PMP certificate?
Cesium load vector data
(3/8)枚举的不当用法 之 方法参数(二)
串口实验——简单数据收发
SAP MM STO单据的外向交货单创建后新加ITEM?
SiteMesh getting started example
Led analog and digital dimming
Interpretation of MySQL optimization principle
Test Engineer Interview Questions 2022
端口复用和重映像
Locust performance test 2 (interface request)
How to pass the PMP Exam in a short time?
Several stages of PMP preparation study
四、机器学习基础
Leetcode刷题记录(数组)组合总和、组合总和 II