public class ChaosMonkeyServlet extends DefaultBlockingServlet
web.xml
file:
Alternatively, the DefaultBlockingServlet can be deployed as a Servlet Filter. This may be necessary in cases where an existing filter is configured in the web application, and that filter interferes with the Errai Bus requests. In this case, configuring DefaultBlockingServlet to handle<servlet>
<servlet-name>ErraiServlet</servlet-name>
<servlet-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ErraiServlet</servlet-name>
<url-pattern>*.erraiBus</url-pattern>
</servlet-mapping>
*.erraiBus
requests ahead of other filters in web.xml will solve the
problem:
<filter>
<filter-name>ErraiServlet</filter-name>
<filter-class>org.jboss.errai.bus.server.servlet.DefaultBlockingServlet</filter-class>
</filter>
<filter-mapping>
<filter-name>ErraiServlet</filter-name>
<url-pattern>*.erraiBus</url-pattern>
</filter-mapping>
<!-- other filter-mapping and servlet-mapping elements go here -->
AbstractErraiServlet.ConnectionPhase
service, sessionProvider, SSE_TERMINATION_BYTES
Constructor and Description |
---|
ChaosMonkeyServlet() |
Modifier and Type | Method and Description |
---|---|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Services this request in the same way as it would be serviced if configured
as a Servlet.
|
protected void |
doGet(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
Called by the server (via the service method) to allow a servlet to handle a GET request by supplying
a response
|
protected void |
doPost(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
Called by the server (via the
service method) to allow a servlet to handle a POST request, by
sending the request |
void |
init(javax.servlet.FilterConfig filterConfig) |
void |
init(javax.servlet.ServletConfig config) |
void |
initAsFilter(javax.servlet.FilterConfig config) |
destroy, getClientId, getConnectionPhase, getLongPollTimeout, getSSETimeout, isLongPollingEnabled, isSSERequest, prepareCometPoll, prepareSSE, prepareSSEContinue, sendDisconnectDueToSessionExpiry, sendDisconnectWithReason, shouldWait, writeExceptionToOutputStream, writeToOutputStream
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class DefaultBlockingServlet
javax.servlet.ServletException
public void initAsFilter(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
initAsFilter
in class DefaultBlockingServlet
javax.servlet.ServletException
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
init
in class DefaultBlockingServlet
javax.servlet.ServletException
protected void doGet(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws javax.servlet.ServletException
doGet
in class DefaultBlockingServlet
httpServletRequest
- - object that contains the request the client has made of the servlethttpServletResponse
- - object that contains the response the servlet sends to the clientIOException
- - if an input or output error is detected when the servlet handles the GET requestjavax.servlet.ServletException
- - if the request for the GET could not be handledprotected void doPost(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws javax.servlet.ServletException
service
method) to allow a servlet to handle a POST request, by
sending the requestdoPost
in class DefaultBlockingServlet
httpServletRequest
- - object that contains the request the client has made of the servlethttpServletResponse
- - object that contains the response the servlet sends to the clientIOException
- - if an input or output error is detected when the servlet handles the requestjavax.servlet.ServletException
- - if the request for the POST could not be handledpublic void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
doFilter
in class DefaultBlockingServlet
IOException
javax.servlet.ServletException
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.