JBoss AS 7.1 +Spring+ZK+DHtmlLayoutServlet

asked 2013-10-22 15:19:47 +0800

moyacuba gravatar image moyacuba


I'm trying to run my webapp that uses spring+zk in JBoss AS 7.1, previously I did succeed to run the application in Tomcat, but in JBoss AS 7.1 it is behaving differently.

In this web app, I did extend the DHtmlLayoutServlet to add some features, hooking the request , etc.

public class DHtmlLayoutServletWrapper extends DHtmlLayoutServlet {
    protected void doGet(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
        super.doGet(new HttpServletRequestWrapper(request), response);

then my web.xml file reference the extended class for the zkLoader servlet:

    <description>El cargador de paginas ZUML</description>

this works pretty well in Tomcat, the filter chain loads the Wrapper class for zul files, but in JBoss AS 7.1, the parent class is the one loaded, it is evidenced in the stacktrace:

at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215) [zk-6.5.3.jar:6.5.3]
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:136) [zk-6.5.3.jar:6.5.3]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]

My questions...

1- Where should I change the servlet configuration so the WebAppContext loads my servlet wrapper instead the default DHtmlLayoutServlet for zul files?

2- If my definition is to load the DHtmlLayoutServletWrapper class... how is it possible that DHtmlLayoutServlet is being called instead?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-10-24 02:12:40 +0800

cor3000 gravatar image cor3000
5069 2 7
ZK Team

updated 2013-10-24 02:21:13 +0800


in case you are using the Servlet 3.0 specification the ZK servlets are loaded from the zk.jar/META-INF/web-fragment.xml in there the servlet is defined like this



in order to override this servlet you need to use the name "DHtmlLayoutServlet"

This is just a guess... but could be an explanation of what is happening in your case.


link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2013-10-22 15:19:47 +0800

Seen: 23 times

Last updated: Oct 24 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More