-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Boot 教程 #7
Labels
Gradle & Maven & Ant
Gradle & Maven & Ant
Spring Boot Web & JSON
Spring Boot Web & JSON
Spring Boot
Spring Boot
Spring 5 & Spring Boot 2
Spring 5 & Spring Boot 2
Comments
Repository owner
locked and limited conversation to collaborators
Jun 4, 2019
Gradle vs Maven
|
how to run java jar filehttps://stackoverflow.com/questions/394616/running-jar-file-on-windows $ java -jar app.jar
|
8080
|
JSONpackage com.xgqfrms.sb.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SbController {
@RequestMapping("/hello")
public String index() {
// String jsonString = {"name": "xgqfrms", "role": "admin", "id": 1234567890};
// return "Hello World";
return "{\"name\": \"xgqfrms\", \"role\": \"admin\", \"id\": \"1234567890\"}";
}
} |
add jar ??? 怎么手动台添加第三方的 jar
https://blog.csdn.net/u012898245/article/details/79210635 maven search & add
|
Jackson |
xgqfrms
added
Spring 5 & Spring Boot 2
Spring 5 & Spring Boot 2
Spring Boot
Spring Boot
Gradle & Maven & Ant
Gradle & Maven & Ant
labels
Jun 4, 2019
package com.xgqfrms.sb.controller;
// import org.apache.catalina.User;
import org.json.JSONObject;
// import com.fasterxml.jackson.databind.util.JSONWrappedObject;
// import com.xgqfrms.sb.model.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class SbController {
// @RequestMapping("/hello")
@RequestMapping(value = "/hello", method = RequestMethod.GET, produces = "application/json")
public String index() {
// String jsonString = {"name": "xgqfrms", "role": "admin", "id": 1234567890};
// return "Hello World";
// return "{\"name\": \"xgqfrms\", \"role\": \"admin\", \"id\":
// \"1234567890\"}";
// return "{\"name\": \"xgqfrms\", \"role\": \"admin\", \"id\": \"1234567890\"}";
return JSONObject.quote("Hello World");
}
// public User getUser() {
// User user = new User();
// user.setUserName("xgqfrms");
// user.setPassWord("123456789");
// return user;
// }
}
// @RestController
// public class SbController {
// @RequestMapping("/hello")
// public String index() {
// private String response;
// public StringResponse(String s) {
// this.response = s;
// }
// }
// } |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Gradle & Maven & Ant
Gradle & Maven & Ant
Spring Boot Web & JSON
Spring Boot Web & JSON
Spring Boot
Spring Boot
Spring 5 & Spring Boot 2
Spring 5 & Spring Boot 2
Spring Boot 教程
https://gitee.com/didispace/SpringBoot-Learning
https://github.com/dyc87112/SpringBoot-Learning
http://blog.didispace.com/Spring-Boot%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B/
https://www.zhihu.com/question/53729800
The text was updated successfully, but these errors were encountered: