Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 应用程序扩展Neo4JCConfiguration时无法使用InterceptorRegistry_Java_Spring_Spring Mvc_Internationalization_Neo4j - Fatal编程技术网

Java 应用程序扩展Neo4JCConfiguration时无法使用InterceptorRegistry

Java 应用程序扩展Neo4JCConfiguration时无法使用InterceptorRegistry,java,spring,spring-mvc,internationalization,neo4j,Java,Spring,Spring Mvc,Internationalization,Neo4j,我正在使用带有graphDb(Neo4j)的spring boot应用程序mvc作为我的数据库。 当我必须为我的应用程序进行国际化时,我遇到了问题。 我的应用程序中有此代码。java public class Application extends Neo4jConfiguration { @Autowired GraphDatabase graphDatabase; @Bean GraphDatabaseService graphDatabaseServic

我正在使用带有graphDb(Neo4j)的spring boot应用程序mvc作为我的数据库。
当我必须为我的应用程序进行国际化时,我遇到了问题。
我的应用程序中有此代码。java

public class Application extends Neo4jConfiguration {

    @Autowired
    GraphDatabase graphDatabase;

    @Bean
    GraphDatabaseService graphDatabaseService() {
        return new GraphDatabaseFactory().newEmbeddedDatabase("my-graphdb");
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
当我尝试实施国际化时,导师说我需要实施:

@Override
public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(localeChangeInterceptor());
}
上述代码需要WebMVCConfigureAdapter扩展该类。
这就是问题所在,我没有使用WebMVCConfigureAdapter,因此无法添加上述方法。
我是否有其他选项可以让我的国际化与Neo4jConfiguration一起很好地工作

  • 你指的是哪本教程

  • 您还可以创建自己的
    Neo4jConfiguration
    子类,并将其导入到启动应用程序上下文中


  • 我刚刚发现如何让它工作。
    我只需要添加扩展WebMVCConfigureAdapter的新文件,并将addInterceptors模块放入该新文件中