Spring Data does not handle Pageable action argument creation

前端 未结 2 1777
庸人自扰
庸人自扰 2020-12-09 05:29

I have a simple controller action:

public class CategoriesController
{
    @RequestMapping(value = { \"/\", \"\" })
         


        
2条回答
  •  不知归路
    2020-12-09 05:55

    Your problem is that you are trying to mix XML configuration and Java Config based configuration. In this particular case that isn't going to work. The bean in the configuration class will be instantiated but that is it, they aren't registered to your configuration.

    You will have to add the beans manually to the ConversionService and your RequestMappingHandlerMapping. Either that our switch, at least your DispatcherServlet configuration to Java Config.

    In XML you can configure additional argument-resolvers by using the tag. (This mimics the configuration from the SpringDataWebConfiguration).

    
        
            
            
        
    
    
    
    
        
    
    

    However the SpringDataWebConfiguration does more then only these 2 resolvers it also registers a DomainClassConverter. If you also want to use that you need some additional configuration.

    
    
    
       
    
    
    
        
            
            
        
    
    
    
    
        
    
    

提交回复
热议问题