java - spring session with dropwizard -


i using dropwizard framework developing rest apis
have managed integrate spring security dropwizard project , works charm.
unfortunately have not been able spring session work dropwizard.

have followed guide using spring session spring security , rest , no session created or http-headers seen though see spring session configuration initialised in dropwizard logs

info [2016-01-21 04:05:53,326] org.springframework.beans.factory.support.defaultlistablebeanfactory: overriding bean definition bean 'httpsessionstrategy': replacing [root bean: class [null]; scope=; abstract=false; lazyinit=false; autowiremode=3; dependencycheck=0; autowirecandidate=true; primary=false; factorybeanname=springsecurityconfig; factorymethodname=httpsessionstrategy; initmethodname=null; destroymethodname=(inferred); defined in com.cr.security.springsecurityconfig] [root bean: class [null]; scope=; abstract=false; lazyinit=false; autowiremode=3; dependencycheck=0; autowirecandidate=true; primary=false; factorybeanname=springsessionconfig; factorymethodname=httpsessionstrategy; initmethodname=null; destroymethodname=(inferred); defined in com.cr.security.springsessionconfig]

what correct way register spring session dropwizard, need tie spring session dropwizard.

edit: have added example spring-security integrated dropwizard.
github repository

this code section wire spring security dropwizard.

//initialize spring context     annotationconfigwebapplicationcontext parent=new annotationconfigwebapplicationcontext();     annotationconfigwebapplicationcontext ctx=new annotationconfigwebapplicationcontext();      parent.refresh();     parent.getbeanfactory().registersingleton("configuration", configuration);     parent.registershutdownhook();     parent.start();      //real main app context has link parent context     ctx.setparent(parent);     ctx.register(securityconfig.class);      //scan apis     ctx.scan("com.poc.dropwizard");     ctx.scan("com.poc.spring");      ctx.refresh();     ctx.registershutdownhook();     ctx.start();      //link spring embedded jetty     environment.servlets().addservletlisteners(new contextloaderlistener(ctx));      //activate spring security filter     dynamic filterregistration=environment.servlets().addfilter("springsecurityfilterchain",delegatingfilterproxy.class);     filterregistration.setinitparameter("listener-class", contextloaderlistener.class.tostring());     filterregistration.addmappingforurlpatterns(enumset.allof(dispatchertype.class), false, "/*"); 

this section not sure how force jetty-dropwizard use spring-session

//link spring-session embedded jetty     //todo - link spring session      environment.servlets().setsessionhandler(new sessionhandler()); 


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -