[ipcamera] Fix servlet exceptions due to non unique names (#14872)

* [ipcamera] Fix servlet exceptions due to non unique names

[IP camera] on OH4 has the same servlet issue that was fixed by PR #14554.  This PR uses that PR as a template to fix the issue in the IPcamera binding.  (That issue being that only one camera was able to stream.) This was tested locally on OH4M2 and it works.

Signed-off-by: Bob Eckhoff  <katmandodo@yahoo.com>
This commit is contained in:
Robert Eckhoff 2023-04-23 15:23:42 -04:00 committed by GitHub
parent edaf9581c0
commit 4d5be1f64c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,7 @@ public abstract class IpCameraServlet extends HttpServlet {
public void startListening() { public void startListening() {
try { try {
initParameters.put("servlet-name", "/ipcamera/" + handler.getThing().getUID().getId());
httpService.registerServlet("/ipcamera/" + handler.getThing().getUID().getId(), this, initParameters, httpService.registerServlet("/ipcamera/" + handler.getThing().getUID().getId(), this, initParameters,
httpService.createDefaultHttpContext()); httpService.createDefaultHttpContext());
} catch (Exception e) { } catch (Exception e) {