zl程序教程

您现在的位置是:首页 >  前端

当前栏目

why there is always a HTTP 302 redirect when clicking workcenter

HTTP is when why there Redirect always 302
2023-09-14 09:02:51 时间

Created by Jerry Wang on Dec 06, 2014

在UI上点击任意一个work center,例如Master Data时,总会在Chrome Network里观察到一个http 302 redirect:
clipboard1
这其实是一个working as designed的behavior:
clipboard2
后台通过解析前台发送的http request里的form fields,能拿到当前需要navigate到哪个work center,这个例子里的workcenter的target id是SRV-MD-WC,
clipboard3
这个navigation event首先交由对应的controller进行处理:
clipboard4
之后生成一个navigation request:
clipboard5
clipboard6

这里能发现框架的处理逻辑是,如果之前的处理没有任何错误,lv_suppress_navigation 为abap_false,则总会在line 183执行一个redirect操作:
clipboard7
redirect的target url通过line 82的方法生成:
clipboard8
这个redirect target url就是Chrome里观察到的紧接着http 302 redirect POST之后的http 200 get:
clipboard9