forked from eugenp/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAEL-1221: How Spring MVC Really Works (eugenp#2892)
- Loading branch information
1 parent
26f38c1
commit d97456e
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
guest/spring-mvc/src/main/java/com/forketyfork/guest/springmvc/web/MyInputResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.forketyfork.guest.springmvc.web; | ||
|
||
public class MyInputResource { | ||
|
||
private String requestMessage; | ||
|
||
public String getRequestMessage() { | ||
return requestMessage; | ||
} | ||
|
||
public void setRequestMessage(String requestMessage) { | ||
this.requestMessage = requestMessage; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
guest/spring-mvc/src/main/java/com/forketyfork/guest/springmvc/web/MyOutputResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.forketyfork.guest.springmvc.web; | ||
|
||
public class MyOutputResource { | ||
|
||
private String responseMessage; | ||
|
||
public MyOutputResource(String responseMessage) { | ||
this.responseMessage = responseMessage; | ||
} | ||
|
||
public String getResponseMessage() { | ||
return responseMessage; | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
...ng-mvc/src/main/java/com/forketyfork/guest/springmvc/web/RestfulWebServiceController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.forketyfork.guest.springmvc.web; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class RestfulWebServiceController { | ||
|
||
@GetMapping("/message") | ||
public MyOutputResource getMessage() { | ||
return new MyOutputResource("Hello!"); | ||
} | ||
|
||
} |