gpt4 book ai didi

java - 出现错误 : The request sent by the client was syntactically incorrect

转载 作者:行者123 更新时间:2023-11-30 03:47:10 25 4
gpt4 key购买 nike

在其中一个操作中,我希望它发布内容。我发送以下值:

        permissionId = $('#permissionId').val();
var emails = $.trim($('#emails', win).val());
var sms = $.trim($('#sendSms', win).is(':checked'));
var email = $.trim($('#sendEmail', win).is(':checked'));
var override = $.trim($('#cannotOverride', win).is(':checked'));

window.location = '/aims/monitoringPermissions/' + permissionId + '/' + emails + '/' + sms + '/' + email+ '/' + override+ '/' + monitId;

但是,当我发送它时,我收到以下错误:

The request sent by the client was syntactically incorrect.

我的 Action 是这样的

  @RequestMapping(value="/monitoringPermissions/{permissionId}/{emails}/{sms}/{email}/{override}/{monitId}", method = RequestMethod.GET)
public ModelAndView submitPermissions(@PathVariable long roleId, @PathVariable String emails,
@PathVariable boolean canSendSMS, @PathVariable boolean canSendEmail, @PathVariable boolean cannotOverride, @PathVariable long monitoringId,Model model, HttpSession session,
Principal principal, @ModelAttribute("permission") MonitoringPermission monitoringPermission) throws Exception {

请帮忙。

最佳答案

您的 @pathvariable 变量名称不正确:

Spring 自动将路径变量与具有完全相同名称的参数匹配应该是这样的:

@RequestMapping(value="/monitoringPermissions/{permissionId}/{emails}/{sms}/{email}/{override}/{monitId}", method = RequestMethod.GET)
public ModelAndView submitPermissions(@PathVariable long permissionId, @PathVariable String emails,
@PathVariable boolean sms, @PathVariable boolean email, @PathVariable boolean override, @PathVariable long monitId,Model model, HttpSession session,
Principal principal, @ModelAttribute("permission") MonitoringPermission monitoringPermission) throws Exception {

或者类似的东西:

@RequestMapping(value="/monitoringPermissions/{permissionId}/{emails}/{sms}/{email}/{override}/{monitId}", method = RequestMethod.GET)
public ModelAndView submitPermissions(@PathVariable("permissionId") long roleId, @PathVariable("emails") String emails,
@PathVariable("sms") boolean canSendSMS, @PathVariable("email") boolean canSendEmail, @PathVariable("override") boolean cannotOverride, @PathVariable("monitId") long monitoringId,Model model, HttpSession session,
Principal principal, @ModelAttribute("permission") MonitoringPermission monitoringPermission) throws Exception {

关于java - 出现错误 : The request sent by the client was syntactically incorrect,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25367510/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com