在spring配置文件裏面,我的項目是applicationContext.xml。
在sqlSessionFactory的bean配置裏面加上官網的配置。
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- PageHelper配置 -->
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageInterceptor">
<property name="properties">
<!--使用下面的方式配置參數,一行配置一個 -->
<value>
params=value1
</value>
</property>
</bean>
</array>
</property>
</bean>