Skip to content

Commit 1c8ba97

Browse files
author
nareshwart
committed
fix
1 parent 7550224 commit 1c8ba97

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/com/devopsdemo/tutorial/addressbook/AddressbookUI.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.devopsdemo.tutorial.addressbook;
22

33
import javax.servlet.annotation.WebServlet;
4+
import javax.servlet.ServletException;
45

56
import com.vaadin.flow.component.button.Button;
67
import com.vaadin.flow.component.grid.Grid;
@@ -9,7 +10,6 @@
910
import com.vaadin.flow.component.textfield.TextField;
1011
import com.vaadin.flow.router.Route;
1112
import com.vaadin.flow.server.VaadinServlet;
12-
import com.vaadin.flow.server.VaadinServletConfiguration;
1313
import com.devopsdemo.tutorial.addressbook.backend.Contact;
1414
import com.devopsdemo.tutorial.addressbook.backend.ContactService;
1515

@@ -68,8 +68,12 @@ private void refreshContacts(String stringFilter) {
6868
contactForm.setVisible(false);
6969
}
7070

71-
@WebServlet(urlPatterns = "/*")
72-
@VaadinServletConfiguration(ui = AddressbookUI.class, productionMode = false)
71+
@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
7372
public static class MyUIServlet extends VaadinServlet {
73+
@Override
74+
protected void servletInitialized() throws ServletException {
75+
super.servletInitialized();
76+
getService().setClassLoader(getClass().getClassLoader());
77+
}
7478
}
7579
}

0 commit comments

Comments
 (0)