diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/service/DBWServiceBindingServlet.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/service/DBWServiceBindingServlet.java index 1018ee3037..5b7e52cc95 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/service/DBWServiceBindingServlet.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/service/DBWServiceBindingServlet.java @@ -23,6 +23,9 @@ * Servlet service */ public interface DBWServiceBindingServlet extends DBWServiceBinding { + default boolean isApplicable(WebApplication application) { + return true; + } void addServlets(APPLICATION application, DBWServletContext servletContext) throws DBException; } diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/jetty/CBJettyServer.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/jetty/CBJettyServer.java index 84fe0e8f03..ac37138be0 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/jetty/CBJettyServer.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/jetty/CBJettyServer.java @@ -118,11 +118,15 @@ public void runServer() { // Add extensions from services CBJettyServletContext servletContext = new CBJettyServletContext(servletContextHandler); - for (DBWServiceBindingServlet wsd : WebServiceRegistry.getInstance().getWebServices(DBWServiceBindingServlet.class)) { - try { - wsd.addServlets(this.application, servletContext); - } catch (DBException e) { - log.error(e.getMessage(), e); + for (DBWServiceBindingServlet wsd : WebServiceRegistry.getInstance() + .getWebServices(DBWServiceBindingServlet.class) + ) { + if (wsd.isApplicable(this.application)) { + try { + wsd.addServlets(this.application, servletContext); + } catch (DBException e) { + log.error(e.getMessage(), e); + } } } diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebServiceBindingSQL.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebServiceBindingSQL.java index ed8740bb74..78065051a4 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebServiceBindingSQL.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebServiceBindingSQL.java @@ -296,9 +296,6 @@ public static WebSQLContextInfo getSQLContext(WebSQLProcessor processor, String @Override public void addServlets(WebApplication application, DBWServletContext servletContext) throws DBException { - if (!application.isMultiuser()) { - return; - } servletContext.addServlet( "sqlResultValueViewer", new WebSQLResultServlet(application, getServiceImpl()), @@ -311,6 +308,11 @@ public void addServlets(WebApplication application, DBWServletContext servletCon ); } + @Override + public boolean isApplicable(WebApplication application) { + return application.isMultiuser(); + } + private static class WebSQLConfiguration { private final Map processors = new HashMap<>();