Как вызвать сервлет из Alexa RequestHandler? - PullRequest
0 голосов
/ 24 мая 2019

Я пытаюсь вызвать сервлет из Java-класса, который реализует RequestHandler (Alexa Skill), но я никогда не смогу войти в него. Есть ли конкретный способ совершать звонки на сервер через alexa?

// Handler
public Optional<Response> handle(HandlerInput input) {
   //I tried with url.openStream () but it doesn't work
}

// Servlet
 public class AlexaServlet extends HttpServlet {


    private static final long serialVersionUID = 1L;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PrintWriter out = resp.getWriter();
        out.println("Hello Alexa");
        out.close();
    }
...