[英]How can I register Alexa V2 Servlet in Spring Boot
使用Alexa,我想调用运行在Google App Engine上的Spring Boot应用程序。 我可以从Alexa-Simulator发送请求,并可以记录请求。
我按照本教程( https://medium.freecodecamp.org/implementing-an-alexa-skill-with-spring-boot-also-why-would-you-do-such-a-thing-9992c0797646 )注册了SpeechletServlet调用我的Intent。
现在,我正在使用Alexa-SDK V2,但我不知道如何在此版本中注册servlet。
@Configuration
公共类AlexaConfig {
@Autowired
private HandlerSpeechlet handlerSpeechlet;
@Bean
public ServletRegistrationBean registerSpeechletServlet() {
SpeechletServlet speechletServlet = new SpeechletServlet();
speechletServlet.setSpeechlet(handlerSpeechlet);
ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(speechletServlet, "/alexa");
return servletRegistrationBean;
}
}
这是我当前对V1的配置,但是如何在V2中进行呢?
我可以按照示例github项目的说明进行修复:
https://github.com/TheSilentHorizon/spring-boot-alexa
只需实现AlexaConfiguration.java类并配置application.properties
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.