我正在使用弹簧靴开发应用程序.在REST控制器中,我更喜欢使用路径变量(@PathVariabale注释).我的代码获取路径变量,但它在网址中包含{}大括号.请任何人建议我解决这个问题
@RequestMapping(value = "/user/item/{loginName}", method = RequestMethod.GET)
public void getSourceDetails(@PathVariable String loginName) {
try {
System.out.println(loginName);
// it print like this {john}
} catch (Exception e) {
LOG.error(e);
}
}
Run Code Online (Sandbox Code Playgroud)
网址
http://localhost:8080/user/item/{john}
Run Code Online (Sandbox Code Playgroud)
输出控制器
{约翰}
我正在使用Spring boot开发一个应用程序.我尝试了所有表示动词,如GET,POST,DELETE都可以正常工作.通过使用PUT方法,它不支持弹簧启动.我是否需要添加任何新配置.
Put方法只能处理请求没有任何参数.如果我添加任何查询参数或表单数据,它不起作用.请任何专业人士帮助我解决这个问题.
@RequestMapping("/student/info")
@RequestMapping(method = RequestMethod.PUT)
public @ResponseBody String updateStudent(@RequestParam(value = "stdName")String stdName){
LOG.info(stdName);
return "ok";
}
Run Code Online (Sandbox Code Playgroud)
请求方法'PUT'不受支持
我想在 x 轴上添加自定义刻度标签,例如此模式中的 1,2,3,4,3,2,1。但是我使用的代码没有显示减少的数字。
var margin = {
top: 100,
right: 100,
bottom: 100,
left: 100
},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var x = d3.scale.ordinal()
.domain([1, 2, 3, 4, 5, 4, 3, 2, 1])
.rangePoints([0, width]);
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom");
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
svg.append("g") …Run Code Online (Sandbox Code Playgroud)