我有一个使用 jquery 显示/隐藏某些字段的视图(jsp)。我正在使用 jquery 使用 ajax 将数据发布到控制器(spring mvc)。当我只是在页面中输入值时效果很好,但是如果我单击一个链接以取消隐藏 2 个文本框,将值输入其中然后发送到控制器,我得到了这个异常。我检查了 spring 日志,我可以看到所有属性都转换为与 spring 绑定,但是在引发异常之后不久。以下是我在日志中可以看到的内容。我已经多次检查了所有参数,并且在 jsp/js/java 中没有任何遗漏/拼写错误。任何帮助将非常感激
19:40:16,875 DEBUG GenericConversionService:254 - Caching under ConverterCacheKey [sourceType = java.lang.String, targetType = @org.springframework.web.bind.annotation.RequestParam java.lang.String]
java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,640 DEBUG GenericConversionService:186 - Converted to 540
19:40:17,644 DEBUG GenericConversionService:139 - Checking if I can convert java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,646 DEBUG GenericConversionService:358 - Searching for converters indexed by sourceType [java.lang.String]
19:40:17,647 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Integer]
19:40:17,649 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,651 DEBUG GenericConversionService:560 - Matching java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,653 DEBUG GenericConversionService:570 - Did not match converter java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,654 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Comparable]
19:40:17,656 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Number]
19:40:17,658 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,660 DEBUG GenericConversionService:576 - Matched converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,661 DEBUG GenericConversionService:254 - Caching under ConverterCacheKey [sourceType = java.lang.String, targetType = @org.springframework.web.bind.annotation.RequestParam int]
19:40:17,663 DEBUG GenericConversionService:147 - Yes, I can convert
19:40:17,665 DEBUG GenericConversionService:159 - Converting value '1380' of java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,667 DEBUG GenericConversionService:246 - Matched cached converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,668 DEBUG GenericConversionService:186 - Converted to 1380
19:40:17,672 DEBUG GenericConversionService:139 - Checking if I can convert java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,673 DEBUG GenericConversionService:358 - Searching for converters indexed by sourceType [java.lang.String]
19:40:17,675 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Integer]
19:40:17,677 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,679 DEBUG GenericConversionService:560 - Matching java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,680 DEBUG GenericConversionService:570 - Did not match converter java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,682 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Comparable]
19:40:17,684 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Number]
19:40:17,685 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,687 DEBUG GenericConversionService:576 - Matched converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,689 DEBUG GenericConversionService:254 - Caching under ConverterCacheKey [sourceType = java.lang.String, targetType = @org.springframework.web.bind.annotation.RequestParam int]
19:40:17,691 DEBUG GenericConversionService:147 - Yes, I can convert
19:40:17,693 DEBUG GenericConversionService:159 - Converting value '540' of java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,694 DEBUG GenericConversionService:246 - Matched cached converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,696 DEBUG GenericConversionService:186 - Converted to 540
19:40:17,699 DEBUG GenericConversionService:139 - Checking if I can convert java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,701 DEBUG GenericConversionService:358 - Searching for converters indexed by sourceType [java.lang.String]
19:40:17,703 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Integer]
19:40:17,705 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,707 DEBUG GenericConversionService:560 - Matching java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,708 DEBUG GenericConversionService:570 - Did not match converter java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,710 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Comparable]
19:40:17,712 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Number]
19:40:17,713 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,715 DEBUG GenericConversionService:576 - Matched converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,717 DEBUG GenericConversionService:254 - Caching under ConverterCacheKey [sourceType = java.lang.String, targetType = @org.springframework.web.bind.annotation.RequestParam int]
19:40:17,719 DEBUG GenericConversionService:147 - Yes, I can convert
19:40:17,720 DEBUG GenericConversionService:159 - Converting value '1380' of java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,722 DEBUG GenericConversionService:246 - Matched cached converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,724 DEBUG GenericConversionService:186 - Converted to 1380
19:40:17,727 DEBUG GenericConversionService:139 - Checking if I can convert java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,729 DEBUG GenericConversionService:358 - Searching for converters indexed by sourceType [java.lang.String]
19:40:17,731 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Integer]
19:40:17,732 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,734 DEBUG GenericConversionService:560 - Matching java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,736 DEBUG GenericConversionService:570 - Did not match converter java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,737 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Comparable]
19:40:17,739 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Number]
19:40:17,741 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,743 DEBUG GenericConversionService:576 - Matched converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,744 DEBUG GenericConversionService:254 - Caching under ConverterCacheKey [sourceType = java.lang.String, targetType = @org.springframework.web.bind.annotation.RequestParam int]
19:40:17,746 DEBUG GenericConversionService:147 - Yes, I can convert
19:40:17,748 DEBUG GenericConversionService:159 - Converting value '540' of java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,750 DEBUG GenericConversionService:246 - Matched cached converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,780 DEBUG GenericConversionService:186 - Converted to 540
19:40:17,784 DEBUG GenericConversionService:139 - Checking if I can convert java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,786 DEBUG GenericConversionService:358 - Searching for converters indexed by sourceType [java.lang.String]
19:40:17,788 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Integer]
19:40:17,790 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,792 DEBUG GenericConversionService:560 - Matching java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,794 DEBUG GenericConversionService:570 - Did not match converter java.lang.String -> @org.springframework.format.annotation.NumberFormat java.lang.Integer: org.springframework.format.number.NumberFormatAnnotationFormatterFactory@4a6ca1a6
19:40:17,795 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Comparable]
19:40:17,797 DEBUG GenericConversionService:429 - and indexed by targetType [java.lang.Number]
19:40:17,799 DEBUG GenericConversionService:473 - Found matchable converters java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,800 DEBUG GenericConversionService:576 - Matched converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,802 DEBUG GenericConversionService:254 - Caching under ConverterCacheKey [sourceType = java.lang.String, targetType = @org.springframework.web.bind.annotation.RequestParam int]
19:40:17,804 DEBUG GenericConversionService:147 - Yes, I can convert
19:40:17,806 DEBUG GenericConversionService:159 - Converting value '1380' of java.lang.String to @org.springframework.web.bind.annotation.RequestParam int
19:40:17,807 DEBUG GenericConversionService:246 - Matched cached converter java.lang.String -> java.lang.Number : org.springframework.core.convert.support.StringToNumberConverterFactory@21e8bf76
19:40:17,809 DEBUG GenericConversionService:186 - Converted to 1380
19:40:17,812 DEBUG HandlerMethodInvoker:173 - Invoking request handler method: public com.zeater.guru.admin.command.ResultVO com.zeater.guru.admin.controller.RestaurantController.addRestaurant(java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,int,int,float,float,int,float,boolean,boolean,int,java.lang.String,java.lang.String,java.lang.String,int,int,int,int,int,int,int,int,int,int,int,int,int,int,org.springframework.ui.Model)
19:40:17,815 DEBUG AnnotationMethodHandlerExceptionResolver:132 - Resolving exception from handler [com.zeater.guru.admin.controller.RestaurantController@144683c2]: java.lang.IllegalArgumentException
19:40:17,818 DEBUG ResponseStatusExceptionResolver:132 - Resolving exception from handler [com.zeater.guru.admin.controller.RestaurantController@144683c2]: java.lang.IllegalArgumentException
19:40:17,820 DEBUG DefaultHandlerExceptionResolver:132 - Resolving exception from handler [com.zeater.guru.admin.controller.RestaurantController@144683c2]: java.lang.IllegalArgumentException
19:40:17,822 DEBUG DispatcherServlet:667 - Cleared thread-bound request context: org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestWrapper@188edd79
19:40:17,824 DEBUG DispatcherServlet:671 - Could not complete request
java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)