cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin" <sergey.beryoz...@progress.com>
Subject Re: Support for Regular Expressions in @Path Annotation using CXF JAX-RS
Date Tue, 25 Nov 2008 17:07:29 GMT
Hi Bruce

Thanks and as I said you sending these test results is welcome.

> I hadn't realized that this 1.0 feature had not yet been implemented.

There's some easy explanation why some features have not been impemented yet or why some which
have are actually not complete - say 
proper matrix parameters support, etc. It's the resource issue. I myself do not rememebr having
an opportunity to work on CXF JAXRS 
say 100% of time for any given week for the last year or so. There were times when I had a
chance to do 50% or so but mostly it was 
15-20% or 0% for a number of weeks. This is hopefully going to change but still it's kind
of tough to keep up as far as the complete 
JAXRS compliance is concerned. CXF 2.2 will have a good JAXRS implementation I believe.

Furthemore our strategy has been not to work 'vertically', that is try to implement as much
JAXRS as possible but, given the 
resource constraints, to implement the features on demand and also try to do some 'horizontal'
work, that is try to bring our JAXRS 
closer to CXF so that it can work better with JAXWS in tandem, provide some good Spring configuration
options or provide things like 
Continuation API (which is really cool - added virtually last week). Now that we support 1.0
api, there're fewer and fewer things 
which will need to be done for 100 % JAXRS compliance - but please don't get surprized if
you see more test failures :-)

The community help is essential. All the bug reports  and patches have helped a lot - likewise
tests like yours are of great help 
too.

> Thanks and I hope you enjoy the holiday,

I wish I had them :-) No such luck in Dublin - so I'll keep coding frantically :-)

Cheers, Sergey

----- Original Message ----- 
From: "Maxfield, Bruce D. (LNG-DAY)" <Bruce.Maxfield@lexisnexis.com>
To: <users@cxf.apache.org>
Sent: Tuesday, November 25, 2008 4:05 PM
Subject: RE: Support for Regular Expressions in @Path Annotation using CXF JAX-RS


Sergey:

That pretty much explains the results.  Once long ago I performed a job
not unlike yours and that made me value good clean test cases.  They
make everyone's lives much easier.

I hadn't realized that this 1.0 feature had not yet been implemented.
Frankly, I ran the tests because I wasn't sure whether this was a CXF
issue or a failure on my part to properly interpret the terse JAX-RS
spec language.

Thanks and I hope you enjoy the holiday,
Bruce

-----Original Message-----
From: Sergey Beryozkin [mailto:sergey.beryozkin@progress.com]
Sent: Tuesday, November 25, 2008 10:56 AM
To: users@cxf.apache.org
Subject: Re: Support for Regular Expressions in @Path Annotation using
CXF JAX-RS

Hi,

Not that I'm impressed with CXF results but I'm very happy seeing and
welcome the test results like this one.
That said, the result is expected as arbitrary regular expressions is a
feature introduced after 0.8 api and at the moment CXF does
not support them yet. That will obviously need to be fixed and it's high
on my agenda. I'll use your tests to verify what I've done

Thanks, Sergey


----- Original Message ----- 
From: "Maxfield, Bruce D. (LNG-DAY)" <Bruce.Maxfield@LexisNexis.com>
To: <users@cxf.apache.org>
Sent: Tuesday, November 25, 2008 3:39 PM
Subject: Support for Regular Expressions in @Path Annotation using CXF
JAX-RS


It appears that the regular expression matching within CXF JAX-RS is not
working properly.  I've used a recent (probably 11/20) 2.2 Trunk Release
of CXF to perform these tests along side Jersey 1.0. Below is the test
case code followed by a series of side-by-side test cases using CXF and
Jersey:



-------------------------------------------------

--------- RESOURCE CODE  ------------

-------------------------------------------------





package com.example.simpleJaxRsResources;





import javax.ws.rs.GET;

import javax.ws.rs.Produces;

import javax.ws.rs.Path;

import javax.ws.rs.MatrixParam;

import javax.ws.rs.PathParam;

import javax.ws.rs.core.Context;

import javax.ws.rs.core.UriInfo;



//@Path("{base:base.+}/{tail}")  - Failed to parse

//@Path("base/{tail}")

//@Path("{base}/{tail}")

//@Path("{base}/{tail}")

//@Path("{base:base.+}/{tail}")

//@Path("{base:.+base}/{tail}")

@Path("{base:base.+suffix}/{tail}")
<mailto://@Path(%22%7bbase:base.+suffix%7d/%7btail%7d%22)>

@Produces("text/plain")

public class FirstResource {



            @GET

            public String getFirstResource(@PathParam("base") String
base,

                                    @PathParam("tail") String tail,

                                    @MatrixParam("matrixParam") String
matrixParm,

                                    @Context UriInfo info) {



                        return "Full Request URI: " +
info.getRequestUri() + "\n" +

                        "base: " + base + "\n" +

                        "tail: " + tail + "\n" +

                        "matrixParm=" + matrixParm;

            }



}

----------------------------------------------

------ TEST CASE RESULTS --------

----------------------------------------------





- USE OF REGEX IN @Path TEST RESULTS -

Using Ecplise 3.2, Apache Tomcat 5.5, Jersey 1.0 and CXF latest build.



=======================================

Test #1 - @Path("{base:base.+}/{tail}")

=======================================



---- JERSEY ----

Full Request URI: http://localhost:8088/Jersey_10/base_suffix/tail

base: base_suffix

tail: tail

matrixParm=null



---- CXF ----

Triggered an exception during Tomcat application start-up with the
following text in the Eclipse console:



Error creating bean with name 'RestCXF_01': Error setting property
values; nested exception is
org.springframework.beans.PropertyBatchUpdateException; nested
PropertyAccessExceptions (1) are:

PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property
'serviceBeans' threw exception; nested exception is
java.util.regex.PatternSyntaxException: Illegal repetition near index 0

/{base:base.+}/([^/]+?)(/.*)?





=======================================

Test #2 - @Path("{base:.+base}/{tail}")

=======================================



---- JERSEY ----

Full Request URI: http://localhost:8089/Jersey_10/prefixbase/tail

base: prefixbase

tail: tail

matrixParm=null





---- CXF ----

Triggered an exception during Tomcat application start-up with the
following text in the Eclipse console:



Error setting property values; nested exception is
org.springframework.beans.PropertyBatchUpdateException; nested
PropertyAccessExceptions (1) are:

PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property
'serviceBeans' threw exception; nested exception is
java.util.regex.PatternSyntaxException: Illegal repetition near index 0

/{base:.+base}/([^/]+?)(/.*)?





=============================================

Test #2 - @Path("{base:base.+suffix}/{tail}")

=============================================



---- JERSEY ----

Full Request URI: http://localhost:8089/Jersey_10/base_core_suffix/tail

base: base_core_suffix

tail: tail

matrixParm=null



---- CXF ----

Triggered an exception during Tomcat application start-up with the
following text in the Eclipse console:



Error creating bean with name 'RestCXF_01': Error setting property
values; nested exception is
org.springframework.beans.PropertyBatchUpdateException; nested
PropertyAccessExceptions (1) are:

PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property
'serviceBeans' threw exception; nested exception is
java.util.regex.PatternSyntaxException: Illegal repetition near index 0

/{base:base.+suffix}/([^/]+?)(/.*)?










Mime
View raw message