resteasy

HttpServletRequest.login does not keep logged in for subsequent requests

大憨熊 提交于 2021-02-19 06:15:29
问题 After logging in using HttpServletRequest.login(String, String) , using the code below, on following requests I still get a Basic Authentication prompt. Why is the login function not working in my configuration? My endpoint: @POST @Path("login") @Consumes(MediaType.APPLICATION_JSON) public void login(@Valid LoginRequest loginRequest) { try { User user = userController.findUserByUsername(loginRequest.getUsername()).orElseThrow(NotFoundException::new); httpServletRequest.login(loginRequest

simple example using resteasy-jaxrs not working

一曲冷凌霜 提交于 2021-02-19 06:13:29
问题 I can't get the message "hello" when I visit the page. package jaxrs.ressources; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @Path("greeting") public class HelloRessource { @GET @Path("hello") @Produces(MediaType.TEXT_PLAIN) public String sayhello() { return "Hello from JAX-RS"; }} and this class package jaxrs.utilities; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application;

Resteasy 3 @Context HttpServletRequest always null

六月ゝ 毕业季﹏ 提交于 2021-02-18 19:48:20
问题 We were using Resteasy 2 but we are upgrading to Resteasy 3 and the HttpServletRequest injection is always null . Our modified security interceptor/filter that looks like: @Provider @ServerInterceptor @Precedence("SECURITY") public class SecurityInterceptor implements ContainerRequestFilter, ContainerResponseFilter { @Context private HttpServletRequest servletRequest; @Override public void filter(ContainerRequestContext requestContext) throws IOException { // Need access to "servletRequest"

Resteasy 3 @Context HttpServletRequest always null

佐手、 提交于 2021-02-18 19:45:33
问题 We were using Resteasy 2 but we are upgrading to Resteasy 3 and the HttpServletRequest injection is always null . Our modified security interceptor/filter that looks like: @Provider @ServerInterceptor @Precedence("SECURITY") public class SecurityInterceptor implements ContainerRequestFilter, ContainerResponseFilter { @Context private HttpServletRequest servletRequest; @Override public void filter(ContainerRequestContext requestContext) throws IOException { // Need access to "servletRequest"

Resteasy 3 @Context HttpServletRequest always null

心已入冬 提交于 2021-02-18 19:45:22
问题 We were using Resteasy 2 but we are upgrading to Resteasy 3 and the HttpServletRequest injection is always null . Our modified security interceptor/filter that looks like: @Provider @ServerInterceptor @Precedence("SECURITY") public class SecurityInterceptor implements ContainerRequestFilter, ContainerResponseFilter { @Context private HttpServletRequest servletRequest; @Override public void filter(ContainerRequestContext requestContext) throws IOException { // Need access to "servletRequest"

Receive Image as multipart file to rest service

馋奶兔 提交于 2021-02-18 18:13:42
问题 I am exposing a restful webservice, where i want to accept image as multipart file in the json body request i dont find anywhere a sample json request so as to hit my rest service from a rest client.my rest service uses this field above the class declaration @Consumes({MediaType.APPLICATION_JSON,MediaType.MULTIPART_FORM_DATA}) can anyone please get me a sample json request 回答1: The purpose of multipart/form-data is to send multiple parts in one request. The parts can have different media

Receive Image as multipart file to rest service

穿精又带淫゛_ 提交于 2021-02-18 18:12:21
问题 I am exposing a restful webservice, where i want to accept image as multipart file in the json body request i dont find anywhere a sample json request so as to hit my rest service from a rest client.my rest service uses this field above the class declaration @Consumes({MediaType.APPLICATION_JSON,MediaType.MULTIPART_FORM_DATA}) can anyone please get me a sample json request 回答1: The purpose of multipart/form-data is to send multiple parts in one request. The parts can have different media

What is the equivalent of @Context UriInfo in Spring Rest

五迷三道 提交于 2021-02-18 10:40:07
问题 I have worked in Jersey and RESTEasy framework earlier and now we will be using Spring Rest for a new project , I don't want to pass all the query params and matrix params as parameters in the method , and usually I would annotate the method with @Context UriInfo and would get all the parameters inside my method in Jersey or RESTEasy Framework for complex parameters. I would like to know if there is any @Context UriInfo in Spring REST, which is similar to RESTEasy or Jersey Framework. I would

Which ReastEasy 4 client dependencies are needed?

穿精又带淫゛_ 提交于 2021-02-11 13:38:56
问题 I've upgraded to ReastEasy 4 on my client, but there are several errors reported depending on the configuration. If I use only resteasy-core-spi and resteasy-client-api , I get Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: org.glassfish.jersey.client.JerseyClientBuilder If I add resteasy-client , I get instead javax.ws.rs.ProcessingException: RESTEASY004655: Unable to invoke request: javax.ws.rs.ProcessingException: RESTEASY003215: could not find

Swagger UI doesn't support uploading a file properly for RestEasy

╄→尐↘猪︶ㄣ 提交于 2021-02-08 10:18:33
问题 I use a JAX-RS (RestEasy) along with a Swagger. One of my endpoint can upload a file. Defined way to upload the file (in RestEasy) is to provide a org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput as a parameter. Here is my endpoint: @PUT @Path("/apis/{id}/file") @Consumes(MediaType.MULTIPART_FORM_DATA) @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "Registers a file.", code = 201, nickname = "registerFile") @ApiResponses( value = { @ApiResponse(code = 201,