-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi
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 {
...
@Override
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:
...
<servlet>
<description>El cargador de paginas ZUML</description>
<servlet-name>zkLoader</servlet-name>
<servlet-class>foopckg.DHtmlLayoutServletWrapper</servlet-class>
<init-param>
<param-name>update-uri</param-name>
<param-value>/zkau</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
...
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?
Hi,
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
<servlet>
<servlet-name>DHtmlLayoutServlet</servlet-name>
<servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
<init-param>
<param-name>update-uri</param-name>
<param-value>/zkau</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
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.
Robert
Asked: 2013-10-22 15:19:47 +0800
Seen: 24 times
Last updated: Oct 24 '13
Controller updating UI every minute
annotation porting from zk 3.6.2 to 6.5.3
How to customize "Processing..." message
Portallayout, portalchildren ordering storage, possible bug
Sniffer Based Monitoring of ZK Apps
The server is temporarily out of service. (syntax error (SyntaxError))