SPATIUM Desktop
주소복사
About Operating System Languages Tools Favorites Notice Visit TEST  
     ADK (2)
     android (3)
     ASP (5)
     ASP.Net (1)
     C# (5)
     HTML (9)
     JAVA (6)
     JavaScript (9)
     jQuery (5)
     Mobile Web (2)
     Oracle (8)
     PHP (7)
     Spring Framework (4)
     SQL (15)
     WPF (5)
   ID  
   Password  
  |  
  Location United States
  IP Address 54.80.87.166
2018. 10
123456
78910111213
14151617
18
1920
21222324252627
28293031
Category  Languages, JAVA
Writer 김태우 Date 2016-02-12 16:31:09 Visit 1236
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