Advertisement
slugmandrew

slugmandrew's DispatchServletModule

Apr 9th, 2013
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 1.29 KB | None | 0 0
  1. package com.utilitiessavings.testapp.server.guice;
  2.  
  3. import javax.inject.Singleton;
  4.  
  5. import com.google.inject.servlet.ServletModule;
  6. import com.gwtplatform.dispatch.shared.ActionImpl;
  7. import com.gwtplatform.dispatch.shared.SecurityCookie;
  8. import com.gwtplatform.dispatch.server.guice.DispatchServiceImpl;
  9. import com.gwtplatform.dispatch.server.guice.HttpSessionSecurityCookieFilter;
  10. import com.utilitiessavings.testapp.server.BlobServiceImpl;
  11. import com.utilitiessavings.testapp.server.Dao;
  12. import com.utilitiessavings.testapp.server.UploadServiceImpl;
  13. import com.utilitiessavings.testapp.shared.LoginInfo;
  14.  
  15. public class DispatchServletModule extends ServletModule
  16. {
  17.    
  18.     // CAN'T DO THIS HERE????
  19.     // String jSessionId=this.getThreadLocalRequest().getSession().getId();
  20.    
  21.     @Override
  22.     public void configureServlets()
  23.     {
  24.         serve("/" + ActionImpl.DEFAULT_SERVICE_NAME).with(DispatchServiceImpl.class);
  25.  
  26.         bindConstant().annotatedWith(SecurityCookie.class).to("DREWCOOKIE");
  27.        
  28.         requestStaticInjection(UploadServiceImpl.class);
  29.         // replaces the below, combined with web.xml entry
  30.         //serve("/testapp4/uploadservice").with(UploadServiceImpl.class);
  31.  
  32.         serve("/testapp4/blobservice").with(BlobServiceImpl.class);
  33.  
  34.         filter("*").through(HttpSessionSecurityCookieFilter.class);
  35.        
  36.        
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement