当前位置:网站首页>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
边栏推荐
- Upgrade Alibaba cloud RDS (relational database service) instance to com mysql. jdbc. exceptions. Troubleshooting of jdbc4.communicationsexception
- Jenkins modifies the system time
- Why is access to the external network prohibited for internal services of the company?
- Leetcode question brushing record (array) combination sum, combination sum II
- Locust performance test 4 (custom load Policy)
- Data association between two interfaces of postman
- 【Istio Network CRD VirtualService、Envoyfilter】
- 【ChaosBlade:节点磁盘填充、杀节点上指定进程、挂起节点上指定进程】
- Postman interface debugging method
- DRF defines views and routes
猜你喜欢
[SVN] what is SVN? How do you use it?
Sublime Text4 download the view in bower and set the shortcut key
C语言指针(特别篇)
STM32 clock system
Interview question: general layout and wiring principles of high-speed PCB
串口實驗——簡單數據收發
2022-06-30 unity core 8 - model import
Jenkins task grouping
PMP Exam Preparation experience systematically improve project management knowledge through learning
Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
随机推荐
How can I apply for a PMP certificate?
【ChaosBlade:节点磁盘填充、杀节点上指定进程、挂起节点上指定进程】
Pycharm importing third-party libraries
Variable parameter of variable length function
Confitest of fixture py
【云原生】DevOps(一):DevOps介绍及Code工具使用
Druid monitoring - Introduction to JMX usage and principle
Mysql数据库-锁-学习笔记
Interpretation of MySQL optimization principle
What are the suggestions for PMP candidates?
Leetcode刷题记录(数组)组合总和、组合总和 II
Pytest+request+allure+excel interface automatic construction from 0 to 1 [five nails / flying Book notice]
【SVN】SVN是什么?怎么使用?
STM32 clock system
Pytest installation (command line installation)
How to pass the PMP Exam in a short time?
Locust performance test 5 (analysis)
【istio简介、架构、组件】
Pytest+request+allure+excel interface automatic construction from 0 to 1 [familiar with framework structure]
MySQL master-slave delay solution