Class SwingBridgeSpringServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable
vaadinx.swing.app.SwingBridgeVaadinServlet: a
SpringServlet whose session lock is virtual-thread-aware, so SB-Emulators' modal
dialogs can park (D_vt_aware_session_lock, R_match_swing_errors case (9)).
A migrated app does not normally name this class.
SwingBridgeAutoConfiguration registers it, so the Spring lane's host app writes no
servlet at all. Name it only to subclass it.
Why not the Vaadin Boot class. On Spring the servlet has to extend
SpringServlet so Vaadin's bean-based route and instantiator discovery keeps working,
and Java has one superclass — so the wrap is reproduced here rather than inherited. The two
classes are deliberately the same shape: createServletService is final and
createSwingBridgeService(DeploymentConfiguration) is the seam, so neither the wrap nor service.init()
can be lost by a subclass.
SpringServlet.context is private final, so this class keeps its own
copy — SpringVaadinServletService needs one and the supertype will not hand it over.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classASpringVaadinServletServicewhose session lock is virtual-thread-aware. -
Field Summary
Fields inherited from class com.vaadin.flow.spring.SpringServlet
PROPERTY_NAMESFields inherited from class com.vaadin.flow.server.VaadinServlet
INTERNAL_VAADIN_SERVLET_VITE_DEV_MODE_FRONTEND_PATHFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
ConstructorsConstructorDescriptionSwingBridgeSpringServlet(org.springframework.context.ApplicationContext context, boolean rootMapping) -
Method Summary
Modifier and TypeMethodDescriptionprotected final com.vaadin.flow.server.VaadinServletServicecreateServletService(com.vaadin.flow.function.DeploymentConfiguration configuration) finalfor the same reason as the Vaadin Boot twin's: this is the seam through which the session-lock wrap could be lost silently, and losing it surfaces later and elsewhere as aStackOverflowErrorin Vaadin internals.createSwingBridgeService(com.vaadin.flow.function.DeploymentConfiguration configuration) The service this servlet runs on, beforeinit().Methods inherited from class com.vaadin.flow.spring.SpringServlet
createDeploymentConfiguration, serviceMethods inherited from class com.vaadin.flow.server.VaadinServlet
createDeploymentConfiguration, createServletService, createStaticFileHandler, createVaadinRequest, destroy, getCurrent, getFrontendMapping, getLastPathParameter, getService, getServletConfig, handleContextOrServletRootWithoutSlash, init, serveStaticOrWebJarRequest, servletInitialized, whenFrontendMappingAvailableMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPatch, doPost, doPut, doTrace, getLastModified, isSensitiveHeader, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
SwingBridgeSpringServlet
public SwingBridgeSpringServlet(org.springframework.context.ApplicationContext context, boolean rootMapping)
-
-
Method Details
-
createServletService
protected final com.vaadin.flow.server.VaadinServletService createServletService(com.vaadin.flow.function.DeploymentConfiguration configuration) throws com.vaadin.flow.server.ServiceException finalfor the same reason as the Vaadin Boot twin's: this is the seam through which the session-lock wrap could be lost silently, and losing it surfaces later and elsewhere as aStackOverflowErrorin Vaadin internals. OverridecreateSwingBridgeService(DeploymentConfiguration).- Overrides:
createServletServicein classcom.vaadin.flow.spring.SpringServlet- Throws:
com.vaadin.flow.server.ServiceException
-
createSwingBridgeService
protected SwingBridgeSpringServlet.SwingBridgeSpringVaadinServletService createSwingBridgeService(com.vaadin.flow.function.DeploymentConfiguration configuration) throws com.vaadin.flow.server.ServiceException The service this servlet runs on, beforeinit(). Override to add your own service behaviour; the return type is what keeps the session-lock wrap in place whatever you return.- Returns:
- a new instance, uninitialized —
createServletService(DeploymentConfiguration)callsinit() - Throws:
com.vaadin.flow.server.ServiceException
-