@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/5066") public class GrpcServlet extends jakarta.servlet.http.HttpServlet
asyncSupported to true. The /contextRoot/urlPattern must match the gRPC services' path, which is
"/full-service-name/short-method-name".
The API is experimental. The authors would like to know more about the real usecases. Users are welcome to provide feedback by commenting on the tracking issue.
| Constructor and Description |
|---|
GrpcServlet(List<? extends BindableService> bindableServices)
Instantiate the servlet serving the given list of gRPC services.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
protected void |
doGet(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response) |
protected void |
doPost(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response) |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, servicepublic GrpcServlet(List<? extends BindableService> bindableServices)
ServerInterceptors.intercept(BindableService, io.grpc.ServerInterceptor...)protected final void doGet(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
throws IOException
doGet in class jakarta.servlet.http.HttpServletIOExceptionprotected final void doPost(jakarta.servlet.http.HttpServletRequest request,
jakarta.servlet.http.HttpServletResponse response)
throws IOException
doPost in class jakarta.servlet.http.HttpServletIOExceptionpublic void destroy()
destroy in interface jakarta.servlet.Servletdestroy in class jakarta.servlet.GenericServlet