You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
(16) |
Apr
(18) |
May
(13) |
Jun
(100) |
Jul
(165) |
Aug
(53) |
Sep
(41) |
Oct
(84) |
Nov
(113) |
Dec
(171) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(84) |
Feb
(30) |
Mar
(75) |
Apr
(113) |
May
(87) |
Jun
(96) |
Jul
(127) |
Aug
(106) |
Sep
(191) |
Oct
(142) |
Nov
(106) |
Dec
(83) |
| 2010 |
Jan
(62) |
Feb
(93) |
Mar
(92) |
Apr
(58) |
May
(52) |
Jun
(104) |
Jul
(109) |
Aug
(94) |
Sep
(75) |
Oct
(54) |
Nov
(65) |
Dec
(38) |
| 2011 |
Jan
(53) |
Feb
(84) |
Mar
(95) |
Apr
(24) |
May
(10) |
Jun
(49) |
Jul
(74) |
Aug
(23) |
Sep
(67) |
Oct
(21) |
Nov
(62) |
Dec
(50) |
| 2012 |
Jan
(26) |
Feb
(7) |
Mar
(9) |
Apr
(5) |
May
(13) |
Jun
(7) |
Jul
(18) |
Aug
(48) |
Sep
(58) |
Oct
(79) |
Nov
(19) |
Dec
(15) |
| 2013 |
Jan
(33) |
Feb
(21) |
Mar
(10) |
Apr
(22) |
May
(39) |
Jun
(31) |
Jul
(15) |
Aug
(6) |
Sep
(8) |
Oct
(1) |
Nov
(4) |
Dec
(3) |
| 2014 |
Jan
(17) |
Feb
(18) |
Mar
(15) |
Apr
(12) |
May
(11) |
Jun
(3) |
Jul
(10) |
Aug
(2) |
Sep
(3) |
Oct
(4) |
Nov
(4) |
Dec
(1) |
| 2015 |
Jan
|
Feb
(6) |
Mar
(5) |
Apr
(13) |
May
(2) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(6) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
| 2016 |
Jan
(10) |
Feb
(3) |
Mar
(8) |
Apr
(4) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2017 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: John U. <uj...@gm...> - 2014-07-11 05:40:58
|
Hi Randy, the ObjectMappers may, in one case, have different behaviour for the same base types, eg, different MixInAnnotations for java.util.Date, because each client might need to serialize and deserialize dates differently. So each client needs a different ContextResolver<ObjectMapper> and therefore, AFAIK, a different ResteasyProviderFactory. Unless there's a way to do this completely differently. –John |
|
From: John U. <uj...@gm...> - 2014-07-10 17:16:57
|
AFAIK, the static getInstance method always returns a single (ie, singleton) factory instance, so if I register providers there, they will be shared by all clients created within the application. Which is exactly what I was trying to avoid. Cheers, John |
|
From: William A. S. <wil...@gm...> - 2014-07-10 14:48:37
|
Hello, There's a static method getInstance. I'd use that. -- *William Antônio Siqueira* *Java Support Analyst* *http://fxapps.blogspot.com <http://fxapps.blogspot.com>* *http://www.williamantonio.wordpress.com <http://www.williamantonio.wordpress.com>* *http://williamprogrammer.com <http://williamprogrammer.com>* 2014-07-09 17:31 GMT-03:00 John Ulric <uj...@gm...>: > Hello everybody. > > If an application needs to create different clients using the RESTEasy > client framework, and each of these clients needs a different provider > configuration, what's the correct way to construct the corresponding > ResteasyProviderFactory instances (to be passed to ClientRequestFactory as > a constructor parameter, probably)? Can I just call the public > ResteasyProviderFactory constructor? Any initializations needed? (I'm > asking because there seems to be quite some initialization and delegation > machinery behind the scenes.) > > Background: The clients need different Jackson ObjectMappers, so the > application uses ResteasyProviderFactory.addContextResolver with > different ContextResolver<ObjectMapper> instances. > > Thanks, John > > > > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |
|
From: John U. <uj...@gm...> - 2014-07-09 20:31:11
|
Hello everybody. If an application needs to create different clients using the RESTEasy client framework, and each of these clients needs a different provider configuration, what's the correct way to construct the corresponding ResteasyProviderFactory instances (to be passed to ClientRequestFactory as a constructor parameter, probably)? Can I just call the public ResteasyProviderFactory constructor? Any initializations needed? (I'm asking because there seems to be quite some initialization and delegation machinery behind the scenes.) Background: The clients need different Jackson ObjectMappers, so the application uses ResteasyProviderFactory.addContextResolver with different ContextResolver<ObjectMapper> instances. Thanks, John |
|
From: Larry M. <lar...@gm...> - 2014-07-08 12:31:36
|
I forked and made the change to test it in my application. Here's the change - there was another typo there, too - I changed that as well: https://github.com/lmeadors/Resteasy/commit/a693cf0c1e67639784207b853c091ec0bb40e196 With this modification, the data sent along with DELETE is parsed and passed along nicely. What can I do to get this change included in a future release? Do I need to create a JIRA issue? Add test cases? Send a pull request? What's the process here? :) Larry |
|
From: Larry M. <lar...@gm...> - 2014-07-07 23:22:37
|
Thanks Bill, Perhaps I wasn't clear - I'm not using the JAX-RS 2.0 client API - I'm implementing the server side of an API from a third party, so I'm constrained on changing the URL and HTTP method. They will be using DELETE and sending data to the URL they are providing and that I'm trying to implement. I can see in the HttpServletInputMessage that it's dealing with PUT requests differently - in the "getFormParameters()" and the "getDecodedFormParameters()" methods. Here's the class I'm reading: https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/plugins/server/servlet/HttpServletInputMessage.java Lines 141 and 155 are where the two methods I'm looking at begin. In a debugger, I can see that the incoming request has the bytes for the posted data - it's just not being parsed and included for DELETE requests, so my @FormParam value is null. If it handled DELETE the same way that it handles PUT, it would work perfectly. Larry |
|
From: Bill B. <bb...@re...> - 2014-07-07 23:00:03
|
JAX-RS 2.0 client API does not have a delete() method that accepts an entity. Tomcat might just be eating payloads from delete. Resteasy runtime doesn't care what kind of HTTP method it is. It will try to extract content if it exists. I suggest switching it to a POST and, if you have to, a different URL for your delete operation. Its not clear to me if DELETE was ever meant to have content. HTTP 1.1 spec isn't very clear on this. On 7/7/2014 6:50 PM, Larry Meadors wrote: > Ha, Sorry: > - apache-tomcat-7.0.47 (AWS elastic beanstalk) > - resteasy 3.0.8.final > - java is "1.7.0_45" locally; it's "1.7.0.51" on AWS > > Larry > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Larry M. <lar...@gm...> - 2014-07-07 22:51:06
|
Ha, Sorry: - apache-tomcat-7.0.47 (AWS elastic beanstalk) - resteasy 3.0.8.final - java is "1.7.0_45" locally; it's "1.7.0.51" on AWS Larry |
|
From: Bill B. <bb...@re...> - 2014-07-07 22:43:11
|
resteasy version? servlet container/version?
On 7/7/2014 6:29 PM, Larry Meadors wrote:
> I'm trying to implement a service that uses a DELETE http method but
> also posts data ("patronId=12345678901111") for the delete operation.
>
> The patronId doesn't appear to be passed along to my resource method.
>
> I tried a couple of different ways of making the call (Cocoa Rest
> Client and curl), but the results were the same, so I walked through
> the code with a debugger.
>
> It looks like there is a workaround in HttpServletInputMessage for
> Tomcat and PUT requests to deal with a similar issue, so I tried
> changing the curl command to use PUT instead of DELETE - that worked.
>
> I haven't tried cloning the repo and changing (the public
> MultivaluedMap<String, String> getFormParameters() and public
> MultivaluedMap<String, String> getDecodedFormParameters() methods),
> but I think that changing the code there to handle "DELETE" the same
> way as "PUT" would resolve this.
>
> Three questions:
>
> - is this something that is an issue or intentional?
> - if it's an issue, is this a known one or did I find a new one?
> - is there a workaround for this?
>
> Larry
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com
|
|
From: Larry M. <lar...@gm...> - 2014-07-07 22:29:50
|
I'm trying to implement a service that uses a DELETE http method but
also posts data ("patronId=12345678901111") for the delete operation.
The patronId doesn't appear to be passed along to my resource method.
I tried a couple of different ways of making the call (Cocoa Rest
Client and curl), but the results were the same, so I walked through
the code with a debugger.
It looks like there is a workaround in HttpServletInputMessage for
Tomcat and PUT requests to deal with a similar issue, so I tried
changing the curl command to use PUT instead of DELETE - that worked.
I haven't tried cloning the repo and changing (the public
MultivaluedMap<String, String> getFormParameters() and public
MultivaluedMap<String, String> getDecodedFormParameters() methods),
but I think that changing the code there to handle "DELETE" the same
way as "PUT" would resolve this.
Three questions:
- is this something that is an issue or intentional?
- if it's an issue, is this a known one or did I find a new one?
- is there a workaround for this?
Larry
|
|
From: Kariem H. <kar...@gm...> - 2014-06-23 19:51:44
|
Hi,
I have some problems with configuring whether I want to validate the
payload provided by the client using the bean validation 1.1 provider.
According to the documentation [1], I only have to declare my own provider
and override whatever I want. I decided to just override
"isMethodValidatable":
---- start
public class AnnotatedMethodValidator extends GeneralValidatorImpl {
...
@Override
public boolean isMethodValidatable(Method m) {
return m.getAnnotation(Valid.class) != null && super.isMethodValidatable(m);
}
}
---- end
As you can see, I only want to perform validation, if the method is annoted
with @javax.validation.Valid.
This class is initialized from a custom registered provider (implementing
ContextResolver<GeneralValidator>). The only problem I have now is that
instead of using my custom implementation, the default implementation
(....validation.ValidatorContextResolver) is still used.
When debugging the code, I saw that
ResteasyProviderFactory.getContextResolver [2] just loads the first context
resolver for the type, which happens to be the default implementation
instead of mine. Is there a non-dirty method I have overseen to put mine in
the front or override the default implementation?
I have tried using META-INF/services//javax.ws.rs.Providers and registering
the provider in my Guice module.
Thank you very much for your help.
Bye,
Kariem
[1]
https://docs.jboss.org/resteasy/docs/3.0.7.Final/userguide/html/Validation.html#d4e2476
[2]
https://github.com/resteasy/Resteasy/blob/3.0.8.Final/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/spi/ResteasyProviderFactory.java#L2143
|
|
From: Kariem H. <kar...@gm...> - 2014-06-23 19:27:09
|
Hi, I think my problem is well represented in https://issues.jboss.org/browse/RESTEASY-1049, at least according to the last comment by Daan. When I run the code I used to run on 3.0.6 now with 3.0.8, I get the following error: java.lang.NoClassDefFoundError: org/jboss/resteasy/cdi/CdiInjectorFactory at org.jboss.resteasy.plugins.validation.GeneralValidatorImpl.isValidatable(GeneralValidatorImpl.java:216) at org.jboss.resteasy.core.ResourceMethodInvoker.<init>(ResourceMethodInvoker.java:124) at org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodRegistry.java:280) at org.jboss.resteasy.core.ResourceMethodRegistry.register(ResourceMethodRegistry.java:251) at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:221) at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:193) at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:179) at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:156) at org.jboss.resteasy.plugins.guice.ModuleProcessor.processInjector(ModuleProcessor.java:57) at org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener.contextInitialized(GuiceResteasyBootstrapServletContextListener.java:58) ... 24 more lines Caused by: java.lang.ClassNotFoundException: org.jboss.resteasy.cdi.CdiInjectorFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 36 more I have opened a pull request (https://github.com/resteasy/Resteasy/pull/511) in order to avoid having to include resteasy-cdi. Please tell me, if this is ok, or I can do more. Thank you, Kariem |
|
From: Steven S. <ssc...@op...> - 2014-06-16 18:28:17
|
Hi everyone,
I am trying to use an API which depends on HTTP 301 redirects.
I’ve declared my interface, e.g.
interface MyApi {
@Path("/version")
@GET
String getVersion();
}
However I cannot figure out how to avoid:
javax.ws.rs.RedirectionException: HTTP 301 Moved Permanently
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:152)
at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:58)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:62)
It looks like the “old” proxy api (org.jboss.resteasy.client.ProxyBuilder) creates proxies that implement ResteasyClientProxy. From there, you can add a ClientInvokerModifier that calls followRedirects() on the ClientInvoker instance.
However various bits along this path are marked @Deprecated and now there is a org.jboss.resteasy.client.jaxrs.ProxyBuilder which seems to supplant this, but does not provide the same functionality to follow redirects.
How is this done now?
Thanks,
Steven
|
|
From: Brian M. <bri...@gm...> - 2014-05-19 13:04:28
|
Thank you. They’re all Booleans now. I felt I needed to report it in case it wasn’t desired behavior.
On May 19, 2014, at 2:16 AM, Weinan Li <we...@re...> wrote:
> Hi Brian,
>
> After some investigations I could confirm RESTEasy will use StringToPrimitive to deal with primitive types:
>
> package org.jboss.resteasy.util;
>
> /**
> * @author <a href="mailto:bi...@bu...">Bill Burke</a>
> * @version $Revision: 1 $
> */
> public class StringToPrimitive {
> public static Object stringToPrimitiveBoxType(Class primitiveType, String value) {
> if (primitiveType.equals(String.class)) return value;
> if (primitiveType.equals(boolean.class)) {
> if (value == null) return Boolean.FALSE;
> return Boolean.valueOf(value);
> }
> if (value == null) value = "0";
> if (primitiveType.equals(int.class)) return Integer.valueOf(value);
> if (primitiveType.equals(long.class)) return Long.valueOf(value);
> if (primitiveType.equals(double.class)) return Double.valueOf(value);
> if (primitiveType.equals(float.class)) return Float.valueOf(value);
> if (primitiveType.equals(byte.class)) return Byte.valueOf(value);
> if (primitiveType.equals(short.class)) return Short.valueOf(value);
> if (primitiveType.equals(boolean.class)) return Boolean.valueOf(value);
> return null;
>
> }
> }
>
> So obviously Boolean.valueOf(“1”) will return false. And seems we can’t bypass this in StringParameterInjector:
>
> try
> {
> if (baseType.isPrimitive()) return StringToPrimitive.stringToPrimitiveBoxType(baseType, strVal);
> }
>
> I’d suggest you to use Boolean type as your query parameter, which works correctly.
>
>
>
> Weinan Li / JBoss
>
>> On May 15, 2014, at 4:22 PM, Weinan Li <we...@re...> wrote:
>>
>> Hi Brian,
>>
>> I’ll look into your example.
>>
>>
>> Weinan Li / JBoss
>>
>>> On May 15, 2014, at 5:34 AM, Brian Mauter <bri...@gm...> wrote:
>>>
>>> Hi, I’d like to accept values other than “true” or “false” for boolean QueryParams (for example, “0” or “1”). It seems that my ParamConverter isn’t being invoked for primitives. I’ve attached a minimal example of what I’m trying to do but some of the most relevant details can be found below.
>>>
>>> My TestService method:
>>> @GET
>>> @Produces(MediaType.TEXT_PLAIN)
>>> public String test( @QueryParam("a") boolean a, @QueryParam("b") Boolean b, @QueryParam("c") int c,
>>> @QueryParam("d") Integer d, @QueryParam("e") String e, @QueryParam("f") Date f ) {
>>> return MessageFormat.format( "a={0}, b={1}, c={2}, d={3}, e={4}, f={5}", a, b, c, d, e, f );
>>> }
>>>
>>> I invoke it with:
>>> curl -4 -v http://localhost:8080/rt/test?a=1\&b=1\&c=0\&d=0\&e=e\&f=20140514160412-0500
>>>
>>> I get back:
>>> a=false, b=true, c=0, d=0, e=e, f=5/14/14 4:04 PM
>>>
>>> My two ParamConverters log their arguments in the getConverter, toString and fromString methods. Here’s the log:
>>> 2014-05-14 16:22:31,656 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.Boolean, genericType=class java.lang.Boolean, annotations=[Ljava.lang.annotation.Annotation;@5ae29e22
>>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.Integer, genericType=class java.lang.Integer, annotations=[Ljava.lang.annotation.Annotation;@7f42ef92
>>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.lang.Integer, genericType=class java.lang.Integer, annotations=[Ljava.lang.annotation.Annotation;@7f42ef92
>>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.String, genericType=class java.lang.String, annotations=[Ljava.lang.annotation.Annotation;@49cd8090
>>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.lang.String, genericType=class java.lang.String, annotations=[Ljava.lang.annotation.Annotation;@49cd8090
>>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.util.Date, genericType=class java.util.Date, annotations=[Ljava.lang.annotation.Annotation;@6ff09a85
>>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.util.Date, genericType=class java.util.Date, annotations=[Ljava.lang.annotation.Annotation;@6ff09a85
>>> 2014-05-14 16:22:31,684 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] fromString value=1
>>> 2014-05-14 16:22:31,684 http-bio-8080-exec-1 DEBUG [DateParamConverter] fromString value=20140514160412-0500
>>>
>>> Notice that parameter a in my TestService is a boolean and b is a Boolean. a is never sent to the ParamConverter whereas b is. The same goes for parameters c and d. Is there a rule that says primitives will always use a built-in ParamConverter?
>>>
>>> This is Tomcat 7.0.39 and RestEasy 3.0.7.Final.
>>>
>>> Thanks,
>>> -Brian
>>>
>>> ------------------------------------------------------------------------------
>>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>>> Instantly run your Selenium tests across 300+ browser/OS combos.
>>> Get unparalleled scalability from the best Selenium testing platform available
>>> Simple to use. Nothing to install. Get started now for free."
>>> http://p.sf.net/sfu/SauceLabs
>>>
>>> _______________________________________________
>>> Resteasy-developers mailing list
>>> Res...@li...
>>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>>
|
|
From: Weinan Li <we...@re...> - 2014-05-19 07:17:07
|
Hi Brian,
After some investigations I could confirm RESTEasy will use StringToPrimitive to deal with primitive types:
package org.jboss.resteasy.util;
/**
* @author <a href="mailto:bi...@bu...">Bill Burke</a>
* @version $Revision: 1 $
*/
public class StringToPrimitive {
public static Object stringToPrimitiveBoxType(Class primitiveType, String value) {
if (primitiveType.equals(String.class)) return value;
if (primitiveType.equals(boolean.class)) {
if (value == null) return Boolean.FALSE;
return Boolean.valueOf(value);
}
if (value == null) value = "0";
if (primitiveType.equals(int.class)) return Integer.valueOf(value);
if (primitiveType.equals(long.class)) return Long.valueOf(value);
if (primitiveType.equals(double.class)) return Double.valueOf(value);
if (primitiveType.equals(float.class)) return Float.valueOf(value);
if (primitiveType.equals(byte.class)) return Byte.valueOf(value);
if (primitiveType.equals(short.class)) return Short.valueOf(value);
if (primitiveType.equals(boolean.class)) return Boolean.valueOf(value);
return null;
}
}
So obviously Boolean.valueOf(“1”) will return false. And seems we can’t bypass this in StringParameterInjector:
try
{
if (baseType.isPrimitive()) return StringToPrimitive.stringToPrimitiveBoxType(baseType, strVal);
}
I’d suggest you to use Boolean type as your query parameter, which works correctly.
Weinan Li / JBoss
> On May 15, 2014, at 4:22 PM, Weinan Li <we...@re...> wrote:
>
>
> Hi Brian,
>
>
> I’ll look into your example.
>
>
>
>
> Weinan Li / JBoss
>
>
>> On May 15, 2014, at 5:34 AM, Brian Mauter <bri...@gm...> wrote:
>>
>>
>> Hi, I’d like to accept values other than “true” or “false” for boolean QueryParams (for example, “0” or “1”). It seems that my ParamConverter isn’t being invoked for primitives. I’ve attached a minimal example of what I’m trying to do but some of the most relevant details can be found below.
>>
>>
>> My TestService method:
>> @GET
>> @Produces(MediaType.TEXT_PLAIN)
>> public String test( @QueryParam("a") boolean a, @QueryParam("b") Boolean b, @QueryParam("c") int c,
>> @QueryParam("d") Integer d, @QueryParam("e") String e, @QueryParam("f") Date f ) {
>> return MessageFormat.format( "a={0}, b={1}, c={2}, d={3}, e={4}, f={5}", a, b, c, d, e, f );
>> }
>>
>>
>> I invoke it with:
>> curl -4 -v http://localhost:8080/rt/test?a=1\&b=1\&c=0\&d=0\&e=e\&f=20140514160412-0500
>>
>>
>> I get back:
>> a=false, b=true, c=0, d=0, e=e, f=5/14/14 4:04 PM
>>
>>
>> My two ParamConverters log their arguments in the getConverter, toString and fromString methods. Here’s the log:
>> 2014-05-14 16:22:31,656 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.Boolean, genericType=class java.lang.Boolean, annotations=[Ljava.lang.annotation.Annotation;@5ae29e22
>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.Integer, genericType=class java.lang.Integer, annotations=[Ljava.lang.annotation.Annotation;@7f42ef92
>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.lang.Integer, genericType=class java.lang.Integer, annotations=[Ljava.lang.annotation.Annotation;@7f42ef92
>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.String, genericType=class java.lang.String, annotations=[Ljava.lang.annotation.Annotation;@49cd8090
>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.lang.String, genericType=class java.lang.String, annotations=[Ljava.lang.annotation.Annotation;@49cd8090
>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.util.Date, genericType=class java.util.Date, annotations=[Ljava.lang.annotation.Annotation;@6ff09a85
>> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.util.Date, genericType=class java.util.Date, annotations=[Ljava.lang.annotation.Annotation;@6ff09a85
>> 2014-05-14 16:22:31,684 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] fromString value=1
>> 2014-05-14 16:22:31,684 http-bio-8080-exec-1 DEBUG [DateParamConverter] fromString value=20140514160412-0500
>>
>>
>> Notice that parameter a in my TestService is a boolean and b is a Boolean. a is never sent to the ParamConverter whereas b is. The same goes for parameters c and d. Is there a rule that says primitives will always use a built-in ParamConverter?
>>
>>
>> This is Tomcat 7.0.39 and RestEasy 3.0.7.Final.
>>
>>
>> Thanks,
>> -Brian
>>
>>
>> ------------------------------------------------------------------------------
>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>> Instantly run your Selenium tests across 300+ browser/OS combos.
>> Get unparalleled scalability from the best Selenium testing platform available
>> Simple to use. Nothing to install. Get started now for free."
>> http://p.sf.net/sfu/SauceLabs
>>
>>
>> _______________________________________________
>> Resteasy-developers mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>>
>>
>>
|
|
From: Weinan Li <we...@re...> - 2014-05-15 15:27:43
|
Hi, I’m reading the code of PropertyInjectorImpl and ResourcePropertyInjector. They all implements PropertyInjector and seems have simliar functions. The difference is that ResourcePropertyInjector has fieldMap which could deal with multiple properties. Can anyone tell me what’s their differences exactly? Thanks! Weinan Li / JBoss |
|
From: Weinan Li <we...@re...> - 2014-05-15 08:22:36
|
Hi Brian,
I’ll look into your example.
Weinan Li / JBoss
> On May 15, 2014, at 5:34 AM, Brian Mauter <bri...@gm...> wrote:
>
>
> Hi, I’d like to accept values other than “true” or “false” for boolean QueryParams (for example, “0” or “1”). It seems that my ParamConverter isn’t being invoked for primitives. I’ve attached a minimal example of what I’m trying to do but some of the most relevant details can be found below.
>
>
> My TestService method:
> @GET
> @Produces(MediaType.TEXT_PLAIN)
> public String test( @QueryParam("a") boolean a, @QueryParam("b") Boolean b, @QueryParam("c") int c,
> @QueryParam("d") Integer d, @QueryParam("e") String e, @QueryParam("f") Date f ) {
> return MessageFormat.format( "a={0}, b={1}, c={2}, d={3}, e={4}, f={5}", a, b, c, d, e, f );
> }
>
>
> I invoke it with:
> curl -4 -v http://localhost:8080/rt/test?a=1\&b=1\&c=0\&d=0\&e=e\&f=20140514160412-0500
>
>
> I get back:
> a=false, b=true, c=0, d=0, e=e, f=5/14/14 4:04 PM
>
>
> My two ParamConverters log their arguments in the getConverter, toString and fromString methods. Here’s the log:
> 2014-05-14 16:22:31,656 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.Boolean, genericType=class java.lang.Boolean, annotations=[Ljava.lang.annotation.Annotation;@5ae29e22
> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.Integer, genericType=class java.lang.Integer, annotations=[Ljava.lang.annotation.Annotation;@7f42ef92
> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.lang.Integer, genericType=class java.lang.Integer, annotations=[Ljava.lang.annotation.Annotation;@7f42ef92
> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.String, genericType=class java.lang.String, annotations=[Ljava.lang.annotation.Annotation;@49cd8090
> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.lang.String, genericType=class java.lang.String, annotations=[Ljava.lang.annotation.Annotation;@49cd8090
> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.util.Date, genericType=class java.util.Date, annotations=[Ljava.lang.annotation.Annotation;@6ff09a85
> 2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.util.Date, genericType=class java.util.Date, annotations=[Ljava.lang.annotation.Annotation;@6ff09a85
> 2014-05-14 16:22:31,684 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] fromString value=1
> 2014-05-14 16:22:31,684 http-bio-8080-exec-1 DEBUG [DateParamConverter] fromString value=20140514160412-0500
>
>
> Notice that parameter a in my TestService is a boolean and b is a Boolean. a is never sent to the ParamConverter whereas b is. The same goes for parameters c and d. Is there a rule that says primitives will always use a built-in ParamConverter?
>
>
> This is Tomcat 7.0.39 and RestEasy 3.0.7.Final.
>
>
> Thanks,
> -Brian
>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
>
>
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
>
>
|
|
From: Brian M. <bri...@gm...> - 2014-05-14 21:34:27
|
Hi, I’d like to accept values other than “true” or “false” for boolean QueryParams (for example, “0” or “1”). It seems that my ParamConverter isn’t being invoked for primitives. I’ve attached a minimal example of what I’m trying to do but some of the most relevant details can be found below.
My TestService method:
@GET
@Produces(MediaType.TEXT_PLAIN)
public String test( @QueryParam("a") boolean a, @QueryParam("b") Boolean b, @QueryParam("c") int c,
@QueryParam("d") Integer d, @QueryParam("e") String e, @QueryParam("f") Date f ) {
return MessageFormat.format( "a={0}, b={1}, c={2}, d={3}, e={4}, f={5}", a, b, c, d, e, f );
}
I invoke it with:
curl -4 -v http://localhost:8080/rt/test?a=1\&b=1\&c=0\&d=0\&e=e\&f=20140514160412-0500
I get back:
a=false, b=true, c=0, d=0, e=e, f=5/14/14 4:04 PM
My two ParamConverters log their arguments in the getConverter, toString and fromString methods. Here’s the log:
2014-05-14 16:22:31,656 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.Boolean, genericType=class java.lang.Boolean, annotations=[Ljava.lang.annotation.Annotation;@5ae29e22
2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.Integer, genericType=class java.lang.Integer, annotations=[Ljava.lang.annotation.Annotation;@7f42ef92
2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.lang.Integer, genericType=class java.lang.Integer, annotations=[Ljava.lang.annotation.Annotation;@7f42ef92
2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.lang.String, genericType=class java.lang.String, annotations=[Ljava.lang.annotation.Annotation;@49cd8090
2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.lang.String, genericType=class java.lang.String, annotations=[Ljava.lang.annotation.Annotation;@49cd8090
2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] rawType=class java.util.Date, genericType=class java.util.Date, annotations=[Ljava.lang.annotation.Annotation;@6ff09a85
2014-05-14 16:22:31,657 http-bio-8080-exec-1 DEBUG [DateParamConverter] rawType=class java.util.Date, genericType=class java.util.Date, annotations=[Ljava.lang.annotation.Annotation;@6ff09a85
2014-05-14 16:22:31,684 http-bio-8080-exec-1 DEBUG [BooleanParamConverter] fromString value=1
2014-05-14 16:22:31,684 http-bio-8080-exec-1 DEBUG [DateParamConverter] fromString value=20140514160412-0500
Notice that parameter a in my TestService is a boolean and b is a Boolean. a is never sent to the ParamConverter whereas b is. The same goes for parameters c and d. Is there a rule that says primitives will always use a built-in ParamConverter?
This is Tomcat 7.0.39 and RestEasy 3.0.7.Final.
Thanks,
-Brian
|
|
From: özhan d. <ozh...@gm...> - 2014-05-12 14:52:44
|
Chekout the undertow server. You could intercept the all http request and modify the content, header or the url. http://undertow.io/documentation/core/reverse-proxy.html 12 Mayıs 2014 Pazartesi tarihinde, Rafael Chies <rc...@re...> yazdı: > Of course it isn't, I was just wondering if it has something that could > help me to not do some unclean code. > tks, > > ----- Original Message ----- > From: "Bill Burke" <bb...@re...> > To: res...@li... > Sent: Monday, May 12, 2014 11:33:55 AM > Subject: Re: [Resteasy-developers] Intercept Request on Server and > redirect to other host > > You have to unpack the request and make another seaprate HTTP request, > IMO. JAX-RS is not a proxy server! > > On 5/11/2014 7:00 AM, Rafael Chies wrote: > > Hi Bernard, thanks for your answer. > > > > It would work if the redirection had to be done for every request. > However, my decision for redirect or not is taken on the server, so I asw > thinking in intercepting the request with the Resteasy API, verify in it if > I have or not to redirect, and if so, I use the own Resteasy API to do this > redirection. The problem is I have searched on Resteasy sources but didn't > find yet how to do this redirection from the two objects that I have in in > hands in my interception (HTTPRequest and ResourceMethod). > > > > Thanks, > > > > ----- Original Message ----- > > From: "Bernard Łabno" <s4...@pj...> > > To: "Rafael Chies" <rc...@re...> > > Cc: res...@li... > > Sent: Sunday, May 11, 2014 7:53:29 AM > > Subject: Re: [Resteasy-developers] Intercept Request on Server and > redirect to other host > > > > Sounds Like a job for mod-rewrite. > > 11 maj 2014 12:51 "Rafael Chies" <rc...@re...> napisał(a): > > > >> Hi folks, > >> > >> I would like to know what is the best approach for intercept a Restful > >> request on Server and so redo this same request but for other > application. > >> The URI and body must be the same, the only thing that must be changed > are > >> the host, port and context-root. > >> > >> First of all I thought doing that with HTTP redirection, but there are > >> some cases that the redirection is for a POST method, and POST > redirection > >> results in a GET request, I don't want this, I want POST being > redirected > >> to the same POST request. > >> > >> Any thoughts would be helpful! > >> > >> Thanks in advance, > >> > >> -- > >> Rafael Chies > >> Senior Middleware Consultant > >> Red Hat Brazil > >> +55 11 35296000 > >> +55 11 996949343 > >> > >> Better technology. Faster innovation. Powered by community > collaboration. > >> See how it works at redhat.com > >> > >> > >> > ------------------------------------------------------------------------------ > >> Is your legacy SCM system holding you back? Join Perforce May 7 to find > >> out: > >> • 3 signs your SCM is hindering your productivity > >> • Requirements for releasing software faster > >> • Expert tips and advice for migrating your SCM now > >> http://p.sf.net/sfu/perforce > >> _______________________________________________ > >> Resteasy-developers mailing list > >> Res...@li... > >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers > >> > > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. > Get unparalleled scalability from the best Selenium testing platform > available > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Resteasy-developers mailing list > |
|
From: Rafael C. <rc...@re...> - 2014-05-12 14:42:18
|
Of course it isn't, I was just wondering if it has something that could help me to not do some unclean code. tks, ----- Original Message ----- From: "Bill Burke" <bb...@re...> To: res...@li... Sent: Monday, May 12, 2014 11:33:55 AM Subject: Re: [Resteasy-developers] Intercept Request on Server and redirect to other host You have to unpack the request and make another seaprate HTTP request, IMO. JAX-RS is not a proxy server! On 5/11/2014 7:00 AM, Rafael Chies wrote: > Hi Bernard, thanks for your answer. > > It would work if the redirection had to be done for every request. However, my decision for redirect or not is taken on the server, so I asw thinking in intercepting the request with the Resteasy API, verify in it if I have or not to redirect, and if so, I use the own Resteasy API to do this redirection. The problem is I have searched on Resteasy sources but didn't find yet how to do this redirection from the two objects that I have in in hands in my interception (HTTPRequest and ResourceMethod). > > Thanks, > > ----- Original Message ----- > From: "Bernard Łabno" <s4...@pj...> > To: "Rafael Chies" <rc...@re...> > Cc: res...@li... > Sent: Sunday, May 11, 2014 7:53:29 AM > Subject: Re: [Resteasy-developers] Intercept Request on Server and redirect to other host > > Sounds Like a job for mod-rewrite. > 11 maj 2014 12:51 "Rafael Chies" <rc...@re...> napisał(a): > >> Hi folks, >> >> I would like to know what is the best approach for intercept a Restful >> request on Server and so redo this same request but for other application. >> The URI and body must be the same, the only thing that must be changed are >> the host, port and context-root. >> >> First of all I thought doing that with HTTP redirection, but there are >> some cases that the redirection is for a POST method, and POST redirection >> results in a GET request, I don't want this, I want POST being redirected >> to the same POST request. >> >> Any thoughts would be helpful! >> >> Thanks in advance, >> >> -- >> Rafael Chies >> Senior Middleware Consultant >> Red Hat Brazil >> +55 11 35296000 >> +55 11 996949343 >> >> Better technology. Faster innovation. Powered by community collaboration. >> See how it works at redhat.com >> >> >> ------------------------------------------------------------------------------ >> Is your legacy SCM system holding you back? Join Perforce May 7 to find >> out: >> • 3 signs your SCM is hindering your productivity >> • Requirements for releasing software faster >> • Expert tips and advice for migrating your SCM now >> http://p.sf.net/sfu/perforce >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers >> > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Resteasy-developers mailing list Res...@li... https://lists.sourceforge.net/lists/listinfo/resteasy-developers -- Rafael Chies Senior Middleware Consultant Red Hat Brazil +55 11 35296000 +55 11 996949343 Better technology. Faster innovation. Powered by community collaboration. See how it works at redhat.com |
|
From: Bill B. <bb...@re...> - 2014-05-12 14:34:03
|
You have to unpack the request and make another seaprate HTTP request, IMO. JAX-RS is not a proxy server! On 5/11/2014 7:00 AM, Rafael Chies wrote: > Hi Bernard, thanks for your answer. > > It would work if the redirection had to be done for every request. However, my decision for redirect or not is taken on the server, so I asw thinking in intercepting the request with the Resteasy API, verify in it if I have or not to redirect, and if so, I use the own Resteasy API to do this redirection. The problem is I have searched on Resteasy sources but didn't find yet how to do this redirection from the two objects that I have in in hands in my interception (HTTPRequest and ResourceMethod). > > Thanks, > > ----- Original Message ----- > From: "Bernard Łabno" <s4...@pj...> > To: "Rafael Chies" <rc...@re...> > Cc: res...@li... > Sent: Sunday, May 11, 2014 7:53:29 AM > Subject: Re: [Resteasy-developers] Intercept Request on Server and redirect to other host > > Sounds Like a job for mod-rewrite. > 11 maj 2014 12:51 "Rafael Chies" <rc...@re...> napisał(a): > >> Hi folks, >> >> I would like to know what is the best approach for intercept a Restful >> request on Server and so redo this same request but for other application. >> The URI and body must be the same, the only thing that must be changed are >> the host, port and context-root. >> >> First of all I thought doing that with HTTP redirection, but there are >> some cases that the redirection is for a POST method, and POST redirection >> results in a GET request, I don't want this, I want POST being redirected >> to the same POST request. >> >> Any thoughts would be helpful! >> >> Thanks in advance, >> >> -- >> Rafael Chies >> Senior Middleware Consultant >> Red Hat Brazil >> +55 11 35296000 >> +55 11 996949343 >> >> Better technology. Faster innovation. Powered by community collaboration. >> See how it works at redhat.com >> >> >> ------------------------------------------------------------------------------ >> Is your legacy SCM system holding you back? Join Perforce May 7 to find >> out: >> • 3 signs your SCM is hindering your productivity >> • Requirements for releasing software faster >> • Expert tips and advice for migrating your SCM now >> http://p.sf.net/sfu/perforce >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers >> > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |
|
From: Bernard Ł. <s4...@pj...> - 2014-05-11 11:51:54
|
Sounds Like a job for mod-rewrite. 11 maj 2014 12:51 "Rafael Chies" <rc...@re...> napisał(a): > Hi folks, > > I would like to know what is the best approach for intercept a Restful > request on Server and so redo this same request but for other application. > The URI and body must be the same, the only thing that must be changed are > the host, port and context-root. > > First of all I thought doing that with HTTP redirection, but there are > some cases that the redirection is for a POST method, and POST redirection > results in a GET request, I don't want this, I want POST being redirected > to the same POST request. > > Any thoughts would be helpful! > > Thanks in advance, > > -- > Rafael Chies > Senior Middleware Consultant > Red Hat Brazil > +55 11 35296000 > +55 11 996949343 > > Better technology. Faster innovation. Powered by community collaboration. > See how it works at redhat.com > > > ------------------------------------------------------------------------------ > Is your legacy SCM system holding you back? Join Perforce May 7 to find > out: > • 3 signs your SCM is hindering your productivity > • Requirements for releasing software faster > • Expert tips and advice for migrating your SCM now > http://p.sf.net/sfu/perforce > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > |
|
From: Rafael C. <rc...@re...> - 2014-05-11 11:00:59
|
Hi Bernard, thanks for your answer. It would work if the redirection had to be done for every request. However, my decision for redirect or not is taken on the server, so I asw thinking in intercepting the request with the Resteasy API, verify in it if I have or not to redirect, and if so, I use the own Resteasy API to do this redirection. The problem is I have searched on Resteasy sources but didn't find yet how to do this redirection from the two objects that I have in in hands in my interception (HTTPRequest and ResourceMethod). Thanks, ----- Original Message ----- From: "Bernard Łabno" <s4...@pj...> To: "Rafael Chies" <rc...@re...> Cc: res...@li... Sent: Sunday, May 11, 2014 7:53:29 AM Subject: Re: [Resteasy-developers] Intercept Request on Server and redirect to other host Sounds Like a job for mod-rewrite. 11 maj 2014 12:51 "Rafael Chies" <rc...@re...> napisał(a): > Hi folks, > > I would like to know what is the best approach for intercept a Restful > request on Server and so redo this same request but for other application. > The URI and body must be the same, the only thing that must be changed are > the host, port and context-root. > > First of all I thought doing that with HTTP redirection, but there are > some cases that the redirection is for a POST method, and POST redirection > results in a GET request, I don't want this, I want POST being redirected > to the same POST request. > > Any thoughts would be helpful! > > Thanks in advance, > > -- > Rafael Chies > Senior Middleware Consultant > Red Hat Brazil > +55 11 35296000 > +55 11 996949343 > > Better technology. Faster innovation. Powered by community collaboration. > See how it works at redhat.com > > > ------------------------------------------------------------------------------ > Is your legacy SCM system holding you back? Join Perforce May 7 to find > out: > • 3 signs your SCM is hindering your productivity > • Requirements for releasing software faster > • Expert tips and advice for migrating your SCM now > http://p.sf.net/sfu/perforce > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- Rafael Chies Senior Middleware Consultant Red Hat Brazil +55 11 35296000 +55 11 996949343 Better technology. Faster innovation. Powered by community collaboration. See how it works at redhat.com |
|
From: Rafael C. <rc...@re...> - 2014-05-11 10:51:07
|
Hi folks, I would like to know what is the best approach for intercept a Restful request on Server and so redo this same request but for other application. The URI and body must be the same, the only thing that must be changed are the host, port and context-root. First of all I thought doing that with HTTP redirection, but there are some cases that the redirection is for a POST method, and POST redirection results in a GET request, I don't want this, I want POST being redirected to the same POST request. Any thoughts would be helpful! Thanks in advance, -- Rafael Chies Senior Middleware Consultant Red Hat Brazil +55 11 35296000 +55 11 996949343 Better technology. Faster innovation. Powered by community collaboration. See how it works at redhat.com |
|
From: Weinan Li <we...@re...> - 2014-04-30 13:35:10
|
my email get rejected by mailing list so I have to remove the attachments. sorry for that.
--
Weinan Li / JBoss
On Wednesday, April 30, 2014 at 8:49 PM, Weinan Li wrote:
> Hi Mark,
>
> I’ve done some testings on resteasy client side caching feature, and it works without any problems. Maybe you’d like to check these test cases as code examples:
>
> - jaxrs/resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/client/cache/ClientCacheTest.java
> - jaxrs/resteasy-jaxrs-testsuite/src/test/java/org/jboss/resteasy/test/nextgen/client/cache/ClientCacheTest.java
>
> According to your questions on ClientRequestFilter, I do see the local cache is used:
>
> protected BrowserCache cache;
> public CacheInterceptor(BrowserCache cache)
> {
> this.cache = cache;
> }
>
>
>
> And the etag is always checked:
>
> BrowserCache.Entry entry = getEntry(request);
> if (entry == null) return;
> if (entry.expired())
>
>
> …
>
> As you can see above, in filter method the local cache is checked. Please note the BrowserCache is the local caching store, and LightweightBrowserCache is the default implementation.
>
> I’ve attached some uml diagrams fyi, wish it's useful to you :-)
> --
> Weinan Li / JBoss
>
>
> On Monday, April 28, 2014 at 3:05 PM, Weinan Li wrote:
>
> > Hi Mark,
> >
> > I’ll look into this and let you know my progress.
> >
> >
> > Weinan Li / JBoss
> >
> > > On Apr 18, 2014, at 6:09 AM, Mark Petrovic <msp...@gm... (mailto:msp...@gm...)> wrote:
> > >
> > > I'm sorry I do not. I studied the code line by line and the question
> > > occurred to me.
> > >
> > > On Thu, Apr 17, 2014 at 2:17 PM, Bill Burke <bb...@re... (mailto:bb...@re...)> wrote:
> > >
> > > > You got a test that reproduces this?
> > > >
> > > > On 4/15/2014 12:43 PM, Mark Petrovic wrote:
> > > >
> > > > > Good day.
> > > > >
> > > > > I am studying HTTP caching, and I have been helped a great deal by
> > > > > a close reading of the Resteasy CacheInterceptor client filter
> > > > > example:
> > > > >
> > > > > https://github.com/resteasy/Resteasy/blob/master/jaxrs/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/cache/CacheInterceptor.java
> > > > >
> > > > > I am still learning and could easily be missing something. But it
> > > > > seems to me that if
> > > > >
> > > > > 1) the client sets an If-None-Match header with an Etag value
> > > > >
> > > > > and
> > > > >
> > > > > 2) there is no local cache entry whatsoever, expired or not, as
> > > > > determined in the ClientRequestFilter implementation
> > > > >
> > > > > and
> > > > >
> > > > > 3) the server returns 304 by virtue of the If-None-Match header
> > > > >
> > > > > then the ClientResponseFilter implementation will try to fetch a
> > > > > response from cache when it is already determined that there is no
> > > > > such entry. Consequently, the client is left with no usable response
> > > > > available from cache or from the origin server.
> > > > >
> > > > > If I am correct, then if there is no cache entry as determined in
> > > > > the ClientRequestFilter implementation, is it appropriate to remove
> > > > > any If-None-Match -type headers before the request is sent?
> > > > >
> > > > > Thank you for your time as I try to understand this.
> > > >
> > > >
> > > > --
> > > > Bill Burke
> > > > JBoss, a division of Red Hat
> > > > http://bill.burkecentral.com
> > > >
> > > > ------------------------------------------------------------------------------
> > > > Learn Graph Databases - Download FREE O'Reilly Book
> > > > "Graph Databases" is the definitive new guide to graph databases and their
> > > > applications. Written by three acclaimed leaders in the field,
> > > > this first edition is now available. Download your free book today!
> > > > http://p.sf.net/sfu/NeoTech
> > > > _______________________________________________
> > > > Resteasy-developers mailing list
> > > > Res...@li... (mailto:Res...@li...)
> > > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Mark
> > >
> > > ------------------------------------------------------------------------------
> > > Learn Graph Databases - Download FREE O'Reilly Book
> > > "Graph Databases" is the definitive new guide to graph databases and their
> > > applications. Written by three acclaimed leaders in the field,
> > > this first edition is now available. Download your free book today!
> > > http://p.sf.net/sfu/NeoTech
> > > _______________________________________________
> > > Resteasy-developers mailing list
> > > Res...@li... (mailto:Res...@li...)
> > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers
> >
>
>
>
> Attachments:
> - org.jboss.resteasy.client.jaxrs.cache.jpg
>
> - org.jboss.resteasy.client.jaxrs.cache.CacheInterceptor.filter(ClientRequestContext).jpg
>
> - org.jboss.resteasy.client.jaxrs.cache.CacheInterceptor.getEntry(ClientRequestContext).jpg
>
|