gpt4 book ai didi

android - 如何在 android studio 中将多个 servlet(Google 端点)添加到 web.xml?

转载 作者:太空狗 更新时间:2023-10-29 15:46:11 24 4
gpt4 key购买 nike

我向我的 android studio google 端点添加了另一个端点,但我无法使其工作。有人知道如何让它工作吗?这是我的 web.xml:

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<servlet>
<servlet-name>SystemServiceServlet</servlet-name>
<servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
<init-param>
<param-name>services</param-name>
<param-value>com.example.mymodule.TestEndpoint.MyEndpoint</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>TestServeletas</servlet-name>
<servlet-class>com.example.mymodule.TestEndpoint.OuniKiousEndpoint</servlet-class>
<init-param>
<param-name>services</param-name>
<param-value>com.example.mymodule.TestEndpoint.OuniKiousEndpoint</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>TestServeletas</servlet-name>
<url-pattern>/_ah/oki/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>SystemServiceServlet</servlet-name>
<url-pattern>/_ah/spi/*</url-pattern>
</servlet-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>

最佳答案

奇怪的是,@iniro 的解决方案对我不起作用,即使它是 gradle plugin's page 上的文档.

对我有用的很简单 editing the web.xml for multi class APIs , 使用逗号分隔的端点:

   <servlet>
<servlet-name>SystemServiceServlet</servlet-name>
<servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
<init-param>
<param-name>services</param-name>
<param-value>com.mybackend.MyEndpoint1, com.mybackend.MyEndpoint2</param-value>
</init-param>
</servlet>
//End of the web.xml file

关于android - 如何在 android studio 中将多个 servlet(Google 端点)添加到 web.xml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24727522/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com