Number Service

NumberService.java

  • Most of the configuration is done via annotations itself. The code just does the business logic (i.e to add 2 numbers)
  • Path("/number/") annotation specifies the relative URI path that this class will serve is /number/
  • Component annotation specifies that this class needs to be auto-detected when spring does the annotation based scan
  • Scope("singleton") annotation specifies that this class needs to be a singleton instance in spring
  • POST annotation specifies that the method will handle HTTP POST requests
  • Consumes( { "application/x-www-form-urlencoded" }) annotation specifies that the method will handle requests with media type application/x-www-form-urlencoded
  • Produces( { "text/plain" }) annotation specifies that the method will respond with the media type text/plain
  • Path("add") annotation specifies the relative URI path that this method will serve is add
  • RestApp - NumberService java file

Who's online

There are currently 0 users and 1 guest online.

Who's new

  • Saravana Peruma...