Re: Adding a Websocket engine to a context that already has a filter

  • From: Oleksiy Stashok <oleksiy.stashok@...>
  • To: users@...
  • Subject: Re: Adding a Websocket engine to a context that already has a filter
  • Date: Fri, 03 May 2013 17:29:06 -0700

Hi Christopher,

can you pls. share the entire app, so it would be easier to test?

Thank you.

WBR,
Alexey.

On 03.05.13 11:56, Christopher Piggott wrote:
I have a jersy/guice/grizzly application that has jersey instantiated as a GuiceFilter.  It goes something like:

WebappContext ctx = new WebappContext( "xt", "" );
ctx.addListener( MyServletContextListener.class );
FilterRegistration filter = ctx.addFilter( "myServletFilter", GuiceFilter.class );

filter.addMappingForUrlPatterns( EnumSet.of( DispatcherType.REQUEST ), "/myJersey/*" );


ws = new HttpServer();


NetworkListener nl = new NetworkListener( "xt-listener", NetworkListener.DEFAULT_NETWORK_HOST, port );

WebSocketAddOn webSocketAddon = new WebSocketAddOn();
nl.registerAddOn( webSocketAddon );

MyWebSocketApp app = new AhmWebSocketApp();
WebSocketEngine.getEngine().register( "", "/ws/*", app );


ServletRegistration sreg = ctx.addServlet( "defaultServlet", MyDefaultServlet.class );
sreg.addMapping( "*" );
ctx.deploy( ws );
ws.addListener( nl );

The problem is that the filter picks up everything it's mapped to, then my default servlet picks up everything else.  Because of that, the /ws/* piece that should be directed to the WSE never gets there.

If there any way to influence the order that these paths are processed, to make it look for /ws/* FIRST ? 

--C




Adding a Websocket engine to a context that already has a filter

Christopher Piggott 05/03/2013

Re: Adding a Websocket engine to a context that already has a filter

Oleksiy Stashok 05/04/2013
Terms of Use; Privacy Policy; Copyright ©2013-2014 (revision 20140418.2d69abc)
 
 
Close
loading
Please Confirm
Close