Skip to content

Commit

Permalink
[amazonechocontrol] Fix Servlet exceptions due to non-unique names (#…
Browse files Browse the repository at this point in the history
…16152)

Fixes #16149

Signed-off-by: Wouter Born <[email protected]>
  • Loading branch information
wborn authored and jlaur committed Dec 31, 2023
1 parent 72e22e2 commit 4269e3e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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;
Expand Down Expand Up @@ -90,7 +91,10 @@ public AccountServlet(HttpService httpService, String id, AccountHandler account
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());
}
Expand Down

0 comments on commit 4269e3e

Please sign in to comment.