resteasy

Resteasy and fileupload: get no content-disposition error

瘦欲@ 提交于 2019-12-04 19:17:23
I have a rest resource to which files can be uploaded. @Path("/rest/input") public class InputResourceBean { @POST @Path("{directory: .*}") @Consumes("multipart/form-data") public void post(final String directory, final MultipartFormDataInput input) { } I've used SOAPUI, curl and a HTML form to test this code and for all of them I get the same error: Could find no Content-Disposition header within part 12:55:19,739 WARN [org.jboss.resteasy.core.SynchronousDispatcher] Failed executing POST /rest/input/myDir: org.jboss.resteasy.spi.ReaderException: java.lang.RuntimeException: Could find no

ClientRequestFactory RestEasy Deprecated… Any other RestEasy alternative ?

一世执手 提交于 2019-12-04 18:09:33
I need to create rest-easy client, using de interface of the RestService created by others... That's work good, except by just one thing... When i update from rest-easy 2.3.5.Final to rest-easy 3.0.x, the ClientRequestFactory class appear like @Deprecated. The actual code is: ClientRequestFactory crf = new ClientRequestFactory(UriBuilder.fromUri("http://url-of-service").build()); SomeRestInterface client = crf.createProxy(SomeRestInterface.class); client.theMethod(); Any one, now what is the alternative of rest-easy for ClientRequestFactory at version 3.0.x? lefloh Resteasy Client-API has been

Resteasy destroys filename encoding on multipart/form-data POST requests

偶尔善良 提交于 2019-12-04 17:08:09
I do a fileupload to the following annotated Restservice @POST @Path("/uploadFile") @Consumes("multipart/form-data") public Response uploadFile(MultipartFormDataInput input) When special characters in the filename like "äÄöÖüÜß" are used, the filename gets corrupted during processing of Resteasy subsystem. I verified this by creating a Logginginterceptor @Provider @ServerInterceptor public class LoggingInterceptor implements PreProcessInterceptor Inside this interceptor, the http fileupload (multipart/form-data) is still correct Content-Disposition: form-data; name="file"; filename="

List all exposed/available endpoints of RestEasy service?

放肆的年华 提交于 2019-12-04 16:55:27
问题 Is it possible to list all exposed/available endpoints of RestEasy service in a simple way? 回答1: There is a RestEasy plugin, "stats", which exposes .../resteasy/registry . It needs to be registered in web.xml : <context-param> <param-name>resteasy.resources</param-name> <param-value>org.jboss.resteasy.plugins.stats.RegistryStatsResource</param-value> </context-param> Example response: <registry> <resource uriTemplate="/resource"> <delete class="org.jboss.resteasy.test.providers.jaxb.resource

How to develop authentication with resteasy?

你离开我真会死。 提交于 2019-12-04 16:43:57
I'm making small web service(1) and I decided to use resteasy to make it. But I need to know what would be best practise to develop authentication with resteasy. And what kind of responses webservice should send? Are responses usually in XML or what format, and what format of XML response should be? Btw. I use jboss 4 and Java 5. http://www.assertionerror.com/2009/02/26/restful-web-services-with-resteasy/ (1) What technology I should use to develop small Java webservice? Authentication: http://www.jboss.org/file-access/default/members/resteasy/freezone/docs/1.2.GA/userguide/html/Authentication

should all dependencies be explicitily mentioned in child pom if the parent pom has Java EE BOM dependency?

非 Y 不嫁゛ 提交于 2019-12-04 16:16:27
In our project, we have separate modules for REST layer, EJB layer and domain (Entity) layer. Here is the dependency on our REST layer: <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jettison-provider</artifactId> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-multipart-provider</artifactId> </dependency> <!-- Resteasy Server Cache --> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-cache-core</artifactId> <

What scope do JAX-RS 2 filters have?

那年仲夏 提交于 2019-12-04 16:00:24
I am using RestEasy 3.0.2 which is one of the first JAX-RS 2 implementations and run my application within a Tomcat 7. I also make use of injection in my application via WELD which is integrated with RestEasy via its CDI adaptor. Everything works fine so far. Now, I wrote an implementation of a ContainerRequestFilter to perform authentication of incoming requests before they hit a resource. The JAX-RS standard says that injection is possible for every resource and every other JAX-RS component that is annotated with a @Provider annotation. Here is a simplified version of my filter

JAX-RS Resource Lifecycle Performance Impact

[亡魂溺海] 提交于 2019-12-04 15:23:42
问题 I know by default JAX-RS endpoints lifecycle is once-per-request , so that the request specific informations can be injected into the instance. And we can also make an endpoints Singleton meaning once-per-application , in which the request specific informations cannot be injected into the instance rather it can be injected into the requested method. 1. So i would like to know which approach is better in terms of performance, either once-per-request or once-per-application . 2. I would also

Can Resteasy look into parameter's type for JAX-RS methods?

会有一股神秘感。 提交于 2019-12-04 11:45:06
We were using Resteasy 3.0.9 for our JAX-RS webservices, and recently switched to 3.0.19, where we started to see a lot of RESTEASY002142: Multiple resource methods match request warnings. For example, we have methods like: @Path("/{id}") public String getSome(UUID id) @Path("/{id}") public String getSome(int id) I'm not sure how it worked in 3.0.9, probably, we just were very lucky as Resteasy seems to select first method from all candidates (and 3.0.19 sorts candidate methods). One solution is to explicitly specify regex: @Path("/{id : [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]

How do I implement client side http caching like a browser?

牧云@^-^@ 提交于 2019-12-04 09:54:23
I use a RESTFul service as a backend to my frontend. The service sets expires/etag/lastmodified headers on it's responses. What I'm looking for is a client-side(favorably java) library which can fetch data from the service and cache it in a pluggable caching backend like ehcache. What I also want to be able to do is automatically prime the cache using background worker threads as soon as an entry is invalidated. Also, it should be smart to do conditional GETs. I've come across http://hc.apache.org/httpcomponents-client-ga/tutorial/html/caching.html Is there any other library anyone knows about