SPATIUM Mobile
주소복사
About Operating System Languages Tools Favorites Notice Visit TEST  
     ADK (3)
     android (3)
     ASP (5)
     ASP.Net (1)
     C# (5)
     HTML (9)
     JAVA (7)
     JavaScript (9)
     jQuery (5)
     Mobile Web (2)
     node.js (1)
     Oracle (8)
     PHP (7)
     Spring Framework (4)
     SQL (17)
     WPF (5)
   ID  
   Password  
  |  
  Location United States
  IP Address 18.221.27.56
2024. 11
12
3456789
10111213141516
1718192021
22
23
24252627282930
Category  Languages, JAVA
Writer 김태우 Date 2016-02-12 16:31:09 Visit 2750
REST Service

 

REST Service

 

Request : 3Tier Architecture

  => Client Tier(Java Server, c# Application), BusinessLogic Tier(REST Web), Database Tier(Oracle)

Env : JDK1.8, Tomcat8, Eclipse, Gradle, SpringFrame4

 



 

Client Tier(JavaServer) : User RestTemplate in SpringFramework4

 

 

 



 

BusinessLogic Tier(REST Web) : Use the @RestController in SprinFramework4

Ref : https://spring.io/guides/gs/rest-service/

src/main/java/hello/GreetingController.java

package hello;

import java.util.concurrent.atomic.AtomicLong;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GreetingController {

    private static final String template = "Hello, %s!";
    private final AtomicLong counter = new AtomicLong();

    @RequestMapping("/greeting")
    public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) {
        return new Greeting(counter.incrementAndGet(),
                            String.format(template, name));
    }
}

 

 

 

Tags  3Tier Architecture, Client Tier, BusinessLogic Tie
  Relation Articles
[Languages-JAVA] REST Service (2016-02-12 16:31:09)
  Your Opinion
Member ID
150 letters
Copyright (C) SPATIUM. All rights reserved.
[SPATIUM]WebMaster Mail