天天看点

why there is always a HTTP 302 redirect when clicking workcenter

Created by Jerry Wang on Dec 06, 2014

在UI上点击任意一个work center,例如Master Data时,总会在Chrome Network里观察到一个http 302 redirect:

why there is always a HTTP 302 redirect when clicking workcenter

这其实是一个working as designed的behavior:

why there is always a HTTP 302 redirect when clicking workcenter

后台通过解析前台发送的http request里的form fields,能拿到当前需要navigate到哪个work center,这个例子里的workcenter的target id是SRV-MD-WC,

why there is always a HTTP 302 redirect when clicking workcenter

这个navigation event首先交由对应的controller进行处理:

why there is always a HTTP 302 redirect when clicking workcenter

之后生成一个navigation request:

why there is always a HTTP 302 redirect when clicking workcenter

这里能发现框架的处理逻辑是,如果之前的处理没有任何错误,lv_suppress_navigation 为abap_false,则总会在line 183执行一个redirect操作:

why there is always a HTTP 302 redirect when clicking workcenter

redirect的target url通过line 82的方法生成:

why there is always a HTTP 302 redirect when clicking workcenter

这个redirect target url就是Chrome里观察到的紧接着http 302 redirect POST之后的http 200 get:

why there is always a HTTP 302 redirect when clicking workcenter

继续阅读