[英]How can I configure OSIV in Spring, not Spring boot?
Spring boot knows that 'true' value is entered by default if OSIV is not configured. Spring 引导知道如果未配置 OSIV,则默认输入“真”值。
So, is OSIV true by default in Spring mvc projects?那么,在 Spring mvc 项目中,OSIV 是否默认为真? is it false?
是假的吗? Also, how can I set it up?
另外,我该如何设置?
Below is what it looks like when I configure OSIV in my spring boot project in application.yml.下面是我在 application.yml 的 spring 引导项目中配置 OSIV 时的样子。
jpa:
open-in-view: true
And next, this is how it looks when I configure jpa in my spring project in context.xml.接下来,这是我在 context.xml 的 spring 项目中配置 jpa 时的样子。
<bean id ="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="jpaProperties">
<props>
<prop key="jpa.open-in-view">true</prop> //I thought to set it up like this, but it doesn't work, and I couldn't find any official documentation for the setup.
</props>
</property>
</bean>
in my web.xml setting bellow在我的 web.xml 设置中
<filter>
<filter-name>OpenEntityManagerInViewFilter</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenEntityManagerInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.