public JwwfServer bindWebapp ( final Class < ? extends User > user , String url ) { if ( ! url . endsWith ( "/" ) ) url = url + "/" ; context . addServlet ( new ServletHolder ( new WebClientServelt ( clientCreator ) ) , url + "" ) ; context . addServlet ( new ServletHolder ( new SkinServlet ( ) ) , url + "__jwwf/skins/*" ) ; ServletHolder fontServletHolder = new ServletHolder ( new ResourceServlet ( ) ) ; fontServletHolder . setInitParameter ( "basePackage" , "net/magik6k/jwwf/assets/fonts" ) ; context . addServlet ( fontServletHolder , url + "__jwwf/fonts/*" ) ; context . addServlet ( new ServletHolder ( new APISocketServlet ( new UserFactory ( ) { @ Override public User createUser ( ) { try { User u = user . getDeclaredConstructor ( ) . newInstance ( ) ; u . setServer ( jwwfServer ) ; return u ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; } } ) ) , url + "__jwwf/socket" ) ; for ( JwwfPlugin plugin : plugins ) { if ( plugin instanceof IPluginWebapp ) ( ( IPluginWebapp ) plugin ) . onWebappBound ( this , url ) ; } return this ; }
Binds webapp to address