Skip to content

Commit

Permalink
fix zk 6.5.1 bug of _impclss NullPointerException, refs #107
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaochong committed Dec 17, 2012
1 parent 3e058c3 commit af59262
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/groovy/org/grails/plugins/zkui/AbstractTagLib.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import org.grails.plugins.zkui.util.ComponentUtil
import org.grails.plugins.zkui.util.InlineUtils
import org.springframework.context.ApplicationContext
import org.springframework.context.ApplicationContextAware
import org.zkoss.lang.ImportedClassResolver
import org.zkoss.web.servlet.http.Https
import org.zkoss.zk.ui.*
import org.zkoss.zk.ui.http.ExecutionImpl
import org.zkoss.zk.ui.http.I18Ns
import org.zkoss.zk.ui.http.WebManager
Expand All @@ -13,15 +15,13 @@ import org.zkoss.zk.ui.impl.RequestInfoImpl
import org.zkoss.zk.ui.metainfo.EventHandler
import org.zkoss.zk.ui.metainfo.PageDefinitions
import org.zkoss.zk.ui.metainfo.ZScript
import org.zkoss.zk.ui.sys.*
import org.zkoss.zkplus.spring.DelegatingVariableResolver

import javax.servlet.ServletContext
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse

import org.zkoss.zk.ui.*
import org.zkoss.zk.ui.sys.*
import org.zkoss.zkplus.spring.DelegatingVariableResolver

abstract class AbstractTagLib implements ApplicationContextAware {
ApplicationContext applicationContext

Expand Down Expand Up @@ -55,7 +55,7 @@ abstract class AbstractTagLib implements ApplicationContextAware {
static def setAttrs(attrs, Component component, servletContext) {
attrs.findAll {
it.value != null
}.each {String attrName, value ->
}.each { String attrName, value ->
if (attrName.startsWith("on")) {
if (ComponentUtil.isAnnotation(value)) {
ComponentUtil.evaluateDynaAttribute(component, attrName, value)
Expand Down Expand Up @@ -115,6 +115,13 @@ abstract class AbstractTagLib implements ApplicationContextAware {
page.setStyle(zkPageStyle)
}
page.addVariableResolver(new DelegatingVariableResolver())

//fix zk 6.5.1 bug of _impclss NullPointerException
def importedClassResolver = new ImportedClassResolver()
page.addClassResolver(importedClassResolver)
page._impclss = importedClassResolver.importedClasses


final Execution exec = new ExecutionImpl(servletContext, request, response, desktop, page)
final boolean cacheable = exec.getDesktop().getDevice().isCacheable()
if (!cacheable) {
Expand Down

0 comments on commit af59262

Please sign in to comment.