-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove beans to depend on zkspringboot (#16)
- By extension fixes #22 as urlMappingFilter will not be used
- Loading branch information
1 parent
e7245a6
commit 23be1f8
Showing
1 changed file
with
0 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,10 @@ import groovy.transform.CompileStatic | |
import groovy.util.logging.Slf4j | ||
import org.springframework.beans.factory.config.CustomScopeConfigurer | ||
import org.springframework.boot.web.servlet.FilterRegistrationBean | ||
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean | ||
import org.springframework.boot.web.servlet.ServletRegistrationBean | ||
import org.springframework.boot.web.servlet.filter.OrderedFilter | ||
import org.springframework.core.Ordered | ||
import org.springframework.core.io.FileSystemResource | ||
import org.zkoss.lang.Library | ||
import org.zkoss.zk.au.http.DHtmlUpdateServlet | ||
import org.zkoss.zk.grails.DesktopCounter | ||
import org.zkoss.zk.grails.ZkBuilder | ||
import org.zkoss.zk.grails.ZkConfigHelper | ||
import org.zkoss.zk.grails.artefacts.* | ||
import org.zkoss.zk.grails.composer.GrailsBindComposer | ||
import org.zkoss.zk.grails.composer.JQueryComposer | ||
|
@@ -31,14 +25,8 @@ import org.zkoss.zk.grails.scope.PageScope | |
import org.zkoss.zk.grails.select.JQuery | ||
import org.zkoss.zk.grails.web.ComposerMapping | ||
import org.zkoss.zk.grails.web.ZKGrailsOpenSessionInViewFilter | ||
import org.zkoss.zk.grails.web.ZKGrailsPageFilter | ||
import org.zkoss.zk.grails.web.ZULUrlMappingsFilter | ||
import org.zkoss.zk.ui.Component | ||
import org.zkoss.zk.ui.Executions | ||
import org.zkoss.zk.ui.http.DHtmlLayoutServlet | ||
import org.zkoss.zk.ui.http.HttpSessionListener | ||
|
||
import javax.servlet.DispatcherType | ||
|
||
@Slf4j | ||
class GrailszkGrailsPlugin extends Plugin { | ||
|
@@ -174,57 +162,11 @@ Chanwit Kaewkasi <[email protected]>: Original author of ZKGrails (versions 2.5. | |
bean.autowire = "byName" | ||
} | ||
|
||
// web.xml | ||
// Filter | ||
// | ||
// e.g. ["zul"] | ||
// | ||
def supportExts = ZkConfigHelper.supportExtensions | ||
boolean supportsAsync = grailsApplication.metadata.getServletVersion() >= "3.0" | ||
|
||
// | ||
// e.g. ["*.zul", "/zkau/*"] | ||
// | ||
def filterUrls = supportExts.collect{ "*." + it } + ["/zkau/*"] | ||
def urls = supportExts.collect { "*.$it" } + ["*.zul", "*.dsp", "*.zhtml", "*.xml2html"] | ||
|
||
// Servlet | ||
auEngine(ServletRegistrationBean, new DHtmlUpdateServlet(), "/zkau/*") | ||
|
||
zkLoader(ServletRegistrationBean, new DHtmlLayoutServlet(), urls as String[]) { | ||
initParameters = [ "update-uri": "/zkau", "compress": "false" ] | ||
loadOnStartup = 0 | ||
} | ||
|
||
GOSIVFilter(FilterRegistrationBean) { | ||
filter = bean(ZKGrailsOpenSessionInViewFilter) | ||
urlPatterns = filterUrls | ||
} | ||
|
||
pageFilter(FilterRegistrationBean) { | ||
name = "sitemesh" | ||
filter = bean(ZKGrailsPageFilter) | ||
urlPatterns = ["/*"] | ||
order = OrderedFilter.HIGHEST_PRECEDENCE | ||
asyncSupported = supportsAsync | ||
dispatcherTypes = EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR) | ||
} | ||
|
||
urlMappingFilter(FilterRegistrationBean) { | ||
name = "urlMapping" | ||
filter = bean(ZULUrlMappingsFilter) | ||
urlPatterns = ["/*"] | ||
order = OrderedFilter.LOWEST_PRECEDENCE | ||
asyncSupported = supportsAsync | ||
dispatcherTypes = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD) | ||
} | ||
|
||
// Listener | ||
ZkSessionCleaner(ServletListenerRegistrationBean) { | ||
listener = bean(HttpSessionListener) | ||
order = Ordered.HIGHEST_PRECEDENCE | ||
} | ||
|
||
// | ||
// Registering ViewModel Beans to support MVVM | ||
// | ||
|