我在控制器中添加了此网址映射
const initialState = {
data:{
names:[],
ages:[],
genders:[],
}
};
function rootReducer (state = initialState, action){
if(action.type === ADD_DATA){
return Object.assign({}, state, {
names: state.data.names.concat(action.payload),
ages: state.data.ages.concat(action.payload),
genders: state.data.genders.concat(action.payload)
});
}
访问此网址时,出现此错误@PostMapping("/print/purchase")
public void nameOfFunction(Request Body here) {
// Some Code here
}
另一件事是我在函数内添加了Exception processing template "mobile/app/daily/report/print/purchase": Er
ror resolving template [mobile/app/daily/report/print/purchase], template might not exist or might not be accessible by any of the configured Template Resolvers
。即使我得到那个错误。 System.out.println("HERE!!!!!)
仍打印在控制台中。
Spring Boot为什么考虑将URL映射作为Thymeleaf模板?
答案 0 :(得分:0)
据我所知,您缺少右引号 只需在您的请求映射的末尾添加“”即可,如下
@PostMapping("/print/purchase")