java - Getting error: The request sent by the client was syntactically incorrect -
on 1 of action want take post of content. sending following values:
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;
however, when send getting following error:
the request sent client syntactically incorrect.
my action looks this
@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 {
please help.
you have incorrect @pathvariable variable names:
spring automatically matches path variable parameter has exact same name should like:
@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 {
or like:
@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 {
Comments
Post a Comment