-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
版本5.0.0 报空指针异常,注册两次分页插件 #26
Comments
正常配置的情况下,只有用 pagehelper-starter 1.0.0 版本才会出现。 单独的分页插件,只有配置多次才会出现。 |
经过断点调试发现,需要以下配置: <bean class="com.github.pagehelper.PageInterceptor">
<property name="properties">
<value>dialect=</value>
</property>
</bean> 根据我的观察, |
在 private void pluginElement(XNode parent) throws Exception {
if (parent != null) {
for (XNode child : parent.getChildren()) {
String interceptor = child.getStringAttribute("interceptor");
Properties properties = child.getChildrenAsProperties();
Interceptor interceptorInstance = (Interceptor) resolveClass(interceptor).newInstance();
interceptorInstance.setProperties(properties);
configuration.addInterceptor(interceptorInstance);
}
}
} 源码中,不管 properties 是否有值,都会执行 setProperties 方法,不是你说的问题。你可以看看这里。 |
生成XMLConfigBuilder的前提是有mybatis的配置文件,可我是用spring的属性配置方式。这样在 |
非常感谢!! |
嗨,我遇到了一个问题,跟 #9 一样。
可我只配置了一次,PageInterceptor中intercept方法却被调用了2次,换成4.2的版本就正常了。
我的设置如下:
请问还有可能是哪里的问题呢?
@wolazy
The text was updated successfully, but these errors were encountered: