当前位置:网站首页>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
边栏推荐
- Original collection of hardware bear (updated on May 2022)
- Synchronized underlying principle, volatile keyword analysis
- Leetcode question brushing record (array) combination sum, combination sum II
- Port occupation troubleshooting
- C language pointer (Part 2)
- Full link voltage test of the e-commerce campaign Guide
- 2020 year end summary
- 2021 year end summary
- E-commerce campaign Guide
- 5A summary: seven stages of PMP learning
猜你喜欢

What is the use of PMP certificate?

PMP Exam Preparation experience systematically improve project management knowledge through learning

Ppt template and material download website (pure dry goods, recommended Collection)

Druid monitoring - Introduction to JMX usage and principle

STM32 clock system

外部中断实现按键实验

Yapi test plug-in -- cross request

数据在内存中的存储

What are the conditions for applying for NPDP?

Error: selenium common. exceptions. WebDriverException: Messag‘geckodriver‘ execute
随机推荐
Unittest simple project
【ChaosBlade:节点磁盘填充、杀节点上指定进程、挂起节点上指定进程】
STM32的时钟系统
[chaosblade: node disk filling, killing the specified process on the node, suspending the specified process on the node]
Port occupation troubleshooting
Variable parameter of variable length function
JWT certification used in DRF
Panel display technology: LCD and OLED
Full link voltage test of the e-commerce campaign Guide
串口實驗——簡單數據收發
Count the number of words C language
Screen automatically generates database documents
Zen - batch import test cases
Interview question: general layout and wiring principles of high-speed PCB
Unityshader introduction essentials personal summary -- Basic chapter (I)
Jenkins automated email
【istio简介、架构、组件】
Locust performance test 5 (analysis)
PMP certificate preparation experience sharing
Connecting mobile phone with ADB