mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[amazonechocontrol] Fix Servlet exceptions due to non-unique names (#16152)
Fixes #16149 Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
parent
d620d261b7
commit
eba975c040
@ -20,6 +20,7 @@ import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@ -90,7 +91,10 @@ public class AccountServlet extends HttpServlet {
|
||||
servletUrlWithoutRoot = "amazonechocontrol/" + URLEncoder.encode(id, StandardCharsets.UTF_8);
|
||||
servletUrl = "/" + servletUrlWithoutRoot;
|
||||
|
||||
httpService.registerServlet(servletUrl, this, null, httpService.createDefaultHttpContext());
|
||||
Hashtable<Object, Object> initParams = new Hashtable<>();
|
||||
initParams.put("servlet-name", servletUrl);
|
||||
|
||||
httpService.registerServlet(servletUrl, this, initParams, httpService.createDefaultHttpContext());
|
||||
} catch (NamespaceException | ServletException e) {
|
||||
throw new IllegalStateException(e.getMessage());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user