Class DemoServletConfiguration
java.lang.Object
com.levigo.jadice.web.demo.common.server.DemoServletConfiguration
This class manually registers those Servlets that require Autowired services and components.
In a "normal" Spring Boot environment you would just add the ServletComponentScan-Annotation and
add the @WebServlet-Annotation to the servlet and everything is fine. In a traditional deployment
(WAR on App-Server) the App-Server registers the servlet, and it doesn't care about the ServletComponentScan.
So what we do is removing the @WebServlet-Annotation and register the servlets with a ServletRegistrationBean.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.web.servlet.ServletRegistrationBean<DownloadExportServlet>
org.springframework.boot.web.servlet.ServletRegistrationBean<FileUploadServiceImpl>
org.springframework.boot.web.servlet.ServletRegistrationBean<DocumentUploadServlet>
-
Constructor Details
-
DemoServletConfiguration
public DemoServletConfiguration()
-
-
Method Details
-
uploadServletRegistrationBean
@Bean public org.springframework.boot.web.servlet.ServletRegistrationBean<DocumentUploadServlet> uploadServletRegistrationBean() -
fileUploadServiceServletRegistrationBean
@Bean public org.springframework.boot.web.servlet.ServletRegistrationBean<FileUploadServiceImpl> fileUploadServiceServletRegistrationBean() -
downloadExportServletRegistrationBean
@Bean public org.springframework.boot.web.servlet.ServletRegistrationBean<DownloadExportServlet> downloadExportServletRegistrationBean()
-