Get the App
SLTechnology News&Howtos  ›  Servers  › 

How controllers in SAP BOPF and Spring frameworks are called

Shulou Source: shulou.com Published: 2022-05-31 14:58:07 11月27日 Update

This article focuses on "how the controller in the SAP BOPF and Spring framework is called", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how the controller in SAP BOPF and Spring framework is called.

The methods of these determination of BOPF do not need to be called by application developer itself, but are called by the BOPF framework by calling interface method.

Spring MVC's @ RequestMapping works similarly, but in a slightly more advanced way, using Java reflection.

The productDetail method of the class ProductPageController adds @ RequestMapping, and the argument is:

When I click the image of a product on product list to enter detail page:

This url containing p will be Spring MVCdelegate to the controller class I registered with @ RequestMapping. You can see from debugger that my controller class has been successfully determine out. So in essence, @ RequestMapping has the same purpose as the usual way to put a CLAS name in a table in ABAP: register, but Annotation is more elegant and simple.

For the principle of scanning, see my blog:

A simulation of Java Spring dependency injection annotation @ Inject in ABAP.

How does component-scan work in Spring Framework

How does @ Autowired work in Spring framework

The name of the method to be executed is here:

Finally, this method is called on line 497 of line by reflection.

The difference of reflection Mechanism between Java and ABAP

Note that in Java, the metadata of each method of each class can be described by an instance of sun.reflect.MethodAccessor, while the granularity reflected in ABAP only goes to Class level, only CL_ABAP_CLASSDESCR, not CL_ABAP_CLASS_METHODDESCR!

At this point, I believe you have a deeper understanding of "how the controller in the SAP BOPF and Spring framework is called". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Method framework reflection controller control content principle name way learning practical deeper simple advanced elegant success interest blog parameters just Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei MariaDB Shulou Information Apple Redmi