• 5.Controller Action Pair
  • Request Mapping Annotation




    Download 1,03 Mb.
    bet2/7
    Sana21.03.2017
    Hajmi1,03 Mb.
    #802
    1   2   3   4   5   6   7

    3.Request Mapping Annotation


    In the server.routing package, create the following annotation:

    We will need this annotation in order to define the routings. It will be placed above each action (method).


    4.Uri Parameter Annotation


    In the server.routing package, create the following annotation:

    This annotation will be used to define the action parameters. It will tell our server that we need to pass a certain parameter from the url to the method.


    5.Controller Action Pair


    Again, in the routing package, create a new class called ControllerActionPair:

    This class will keep our routing info. The action field will be the method that we are going to invoke for the given route. The controller field keeps the metadata about our controller. The argumentMapping map keeps the index of the parameter and its type.



    Download 1,03 Mb.
    1   2   3   4   5   6   7




    Download 1,03 Mb.