You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<.> Call this method from your web controller instead of relying on the OSIV interceptor.
73
+
Thus you have a clean transactional boundary at the service level.
74
+
+
75
+
If you still want to have the interceptor, you can enable it on a Spring Boot application with `spring.data.neo4j.open-in-view=true` or in a plain Spring application with a configuration like that:
public class MyWebAppConfigurationForSpringDataRest {
126
+
127
+
@Bean // <.>
128
+
public OpenSessionInViewInterceptor openSessionInViewInterceptor() {
129
+
return new OpenSessionInViewInterceptor();
130
+
}
131
+
132
+
@Bean // <.>
133
+
public MappedInterceptor mappedOSIVInterceptor(OpenSessionInViewInterceptor openSessionInViewInterceptor) {
134
+
return new MappedInterceptor(new String[] { "/**" }, openSessionInViewInterceptor);
135
+
}
136
+
}
137
+
----
138
+
<.> You don't need this bean if you already have the open-session-in-view interceptor, either through the Spring Boot property or manual configuration.
139
+
<.> This `MappedInterceptor` is required to enable open-session-in-view for Spring Data Rest.
140
+
35
141
How do I set up my Spring Configuration with a Java Servlet 3.x+ Container project?::
36
142
If you are using a Java Servlet 3.x+ Container, you can configure a Servlet filter with Spring's `AbstractAnnotationConfigDispatcherServletInitializer` like this:
143
+
+
37
144
[source,java]
38
145
----
39
146
public class MyAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
0 commit comments