我的 Web 应用程序已开始返回 PUT 请求的 403 错误。但是,我在日志中没有看到此请求的任何调试消息,因此我对如何进一步调试它感到困惑。
该代码曾经可以工作,但最近发生了一些变化:
客户端是 Sencha JS:
Ext.Ajax.request({
url : '/RestWAR/personal/trailSegment/' + trailSegment.id + '.json',
method : 'PUT',
headers : {'Content-Type': 'application/json'},
jsonData : segmentDto
});
容器是 Apache Tomcat 6.0。
请求先转到 Spring Security 3.0.0.RC1,然后再转到 Spring 3.0.5。
@Controller
@RequestMapping("/personal")
public class PersonalController {
@RequestMapping(value = "trailSegment/{trailSegmentId}", method=RequestMethod.PUT)
public void updateTrailSegment(@PathVariable long trailSegmentId, @RequestBody PersonalTrailSegmentDTO trailSegmentDto) {
//...
}
}
近期变动:
Spring 版本为 3.0.0.M4,json 库为 net.sf.json-lib 1.0.2。
Spring 现在是 3.0.5,json 库现在是 Jackson Mapper ASL 1.4.2(即 Spring 推荐的)。
GET 和 POST 工作正常。只是 PUT 失败了。
如果涉及 Spring Security,那么我会看到来自 Spring Security 的调试消息,但我什么也看不到。 Tomcat 似乎正在停止该请求。
预先感谢您的任何帮助 - 特别是在调试方面。