GeezerVison is showing github.com — fix · vamsidulla/samplejavaapp@1c8ba97
File tree
Expand file treeCollapse file tree
Open diff view settings
src/main/java/com/devopsdemo/tutorial/addressbook
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/main/java/com/devopsdemo/tutorial/addressbook/AddressbookUI.java +7-3Lines changed: 7 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | package com.devopsdemo.tutorial.addressbook; |
2 | 2 |
|
3 | 3 | import javax.servlet.annotation.WebServlet; |
| 4 | +import javax.servlet.ServletException; |
4 | 5 |
|
5 | 6 | import com.vaadin.flow.component.button.Button; |
6 | 7 | import com.vaadin.flow.component.grid.Grid; |
|
9 | 10 | import com.vaadin.flow.component.textfield.TextField; |
10 | 11 | import com.vaadin.flow.router.Route; |
11 | 12 | import com.vaadin.flow.server.VaadinServlet; |
12 | | -import com.vaadin.flow.server.VaadinServletConfiguration; |
13 | 13 | import com.devopsdemo.tutorial.addressbook.backend.Contact; |
14 | 14 | import com.devopsdemo.tutorial.addressbook.backend.ContactService; |
15 | 15 |
|
@@ -68,8 +68,12 @@ private void refreshContacts(String stringFilter) { |
68 | 68 | contactForm.setVisible(false); |
69 | 69 | } |
70 | 70 |
|
71 | | - @WebServlet(urlPatterns = "/*") |
72 | | - @VaadinServletConfiguration(ui = AddressbookUI.class, productionMode = false) |
| 71 | + @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true) |
73 | 72 | public static class MyUIServlet extends VaadinServlet { |
| 73 | + @Override |
| 74 | + protected void servletInitialized() throws ServletException { |
| 75 | + super.servletInitialized(); |
| 76 | + getService().setClassLoader(getClass().getClassLoader()); |
| 77 | + } |
74 | 78 | } |
75 | 79 | } |