resteasy

How to make Resteasy 2.3.6 use Jackson 2.+

痞子三分冷 提交于 2019-12-07 12:37:15
问题 IS there a way to make RestEasy use Jackson 2+ ? It seems that RestEasy Jackson provider uses Jackson 1.9.9 and it's still a case for ResetEasy 3. 回答1: It occured to be quite simple. There are Jackson JAXRS providers in Jackson 2 already. jackson-jaxrs-xml-provider jackson-jaxrs-json-provider jackson-jaxrs-smile-provider So on the pom.xml <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> <version>2.2.2</version> </dependency> It's

Integrating spring-boot with RESTEasy

流过昼夜 提交于 2019-12-07 12:00:27
问题 I am trying to prototype a Spring Boot application. I'm coming from a Guice JAX-RS application, so I prefer the standard JAX-RS annotations to Spring MVC. I've gotten Jetty up and serving: @Configuration @Import({ResteasyBootstrap.class, SpringBeanProcessorServletAware.class, HttpServletDispatcher.class}) public class EmbeddedJetty { @Bean @Singleton public EmbeddedServletContainerFactory servletContainer() { JettyEmbeddedServletContainerFactory factory = new

Dynamically change RESTEasy service return type

不羁岁月 提交于 2019-12-07 10:14:54
问题 Am I able to change the value of @Produces annotation parameter in my RESTEasy services?? The task I'm given is to integrate multiple format reporting to an existing reporting system. So changing the @Produces annotation parameter dynamically would help me a lot. Thanks in advance! 回答1: Make your method return a Response object and try something like this; int status = 200; String type = MediaType.APPLICATION_XML; String response = "<hello>world</hello>"; return Response.status(status).type

How to set HTTP header in RESTEasy 3.0 client framework (with ResteasyClientBuilder and ResteasyWebTarget)?

不问归期 提交于 2019-12-07 07:57:25
问题 I'm trying to figure out how to set HTTP headers similar to what was explained here: How to set HTTP header in RESTEasy client framework?, or here RESTEasy client framework authentication credentials However, I want to use RESTeasy 3.0 functionality (ResteasyClientBuilder and ResteasyWebtarget) and not the deprecated ProxyFactory, as explained here: What is the substitute for Resteasy ProxyFactory class And just to clarify, I also do not want to set the header(s) on every request / don't want

RESTEasy doesn't recognize custom message body writer

隐身守侯 提交于 2019-12-07 06:44:41
问题 My MessageBodyWriter @Provider @Produces("text/csv") public class CSVMessageBodyWriter implements MessageBodyWriter<JaxbList> public static final String CONTENT_DISPOSITION_HEADER = "Content-Disposition"; //$NON-NLS-1$ private final static HeaderDelegate<ContentDispositionHeader> header = RuntimeDelegate.getInstance().createHeaderDelegate(ContentDispositionHeader.class); public long getSize(JaxbList t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return -1

RESTEasy - javax.ws.rs.NotFoundException: Could not find resource for full path

只愿长相守 提交于 2019-12-07 06:43:17
问题 I've tried to implement a REST service with RESTEasy in a GWT project, but when I get into the respective URI the application returns: Grave: failed to execute javax.ws.rs.NotFoundException: Could not find resource for full path: http://127.0.0.1:8888/api/matches at org.jboss.resteasy.core.registry.ClassNode.match(ClassNode.java:73) at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48) at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker

Resteasy generally enable GZIP

為{幸葍}努か 提交于 2019-12-07 05:31:18
问题 I have a RestEasy + Java EE application. When I add @GZIP to a component class, the server-answer is gzipped, if the client sends "accepts:gzip" Is there a way to generally enable gzip for all components? I don't like to add the annotation to every class. I'm using RestEasy JAX-RS 3.0.1 回答1: No, there is no way with annotations to enable gzip for all resources. If you wanted to forego adding the annotation to every class you could create a servlet filter that looks at the incoming headers and

Getting “java.lang.ClassNotFoundException: javax.servlet.http.HttpServlet” in Eclipse + jboss 5.1.0

南楼画角 提交于 2019-12-07 04:14:00
问题 I'm trying to get a simple RestEasy project to work in Eclipse (with Jboss Tools) and Jboss 5.1.0. To get going, I've created a simple Dynamic Web Project. In the project, I've include the following in WEB-INF/web.xml: <context-param> <param-name>resteasy.scan</param-name> <param-value>true</param-value> </context-param> <listener> <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class> </listener> <servlet> <servlet-name>Resteasy</servlet-name> <servlet

HTTP Handler and Resteasy Deployment with undertow and resteasy

只谈情不闲聊 提交于 2019-12-07 02:36:59
问题 I am trying to run both HTTPServer and also the REST Handler. Only one works at a time not able to make it work both at same time. I need to serve html pages and also the api. here is my code. public class HttpServer { private final UndertowJaxrsServer server = new UndertowJaxrsServer(); private static String rootPath = System.getProperty("user.dir"); private final Undertow.Builder serverBuilder; public HttpServer(Integer port, String host) { serverBuilder = Undertow .builder()

Basic Authentication with Resteasy client

二次信任 提交于 2019-12-07 02:30:16
问题 I'm trying to perform an basic auth to the login-module which runs on my jboss using REST. I already found an StackOverflow topic which explains how to authenticate with credentials. RESTEasy client framework authentication credentials This does not work. Analysing the established connection with Wireshark I was not able to see an HTTP package with Authorization: Basic. After more research I found this article, http://docs.jboss.org/resteasy/docs/2.3.3.Final/userguide/html/RESTEasy_Client