You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Dev1 <de...@gmail.com> on 2013/08/16 02:38:48 UTC

Query params check

Hi all,

I have a CXF REST WS URL that supports unknown number of query parameters.
I get the query paramters from  uriInfo - @context uriInfo.

The system requires that some of the query params cannot be not empty => the
key and the associated value cannot be empty. 

I can programatically check for non-null key and value. But I want to avoid
this approach and see if there any other approach in CXF.

Thus, is there a way in CXF to restrict the REST WS user to always send
non-empty values in the *key* and *value* of a query param? 

Example - If this is one of the query parameter that is being sent in the
url   -  useName=xyz
then both the *key* and the *value* *cannot be empty. *

Hope to know your input.

Thanks in advance.



--
View this message in context: http://cxf.547215.n5.nabble.com/Query-params-check-tp5732539.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Query params check

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

If you had individual parameters typed in the signature then it would be 
simplere to do, using primitive types where possible, example, 'int', or 
introducing custom types and validating them with ParamConverter would 
do, but it is not possible in the unbounded number of parameters case, 
given that you bypass it by directly interfacing with UriInfo

Cheers, Sergey
On 16/08/13 03:38, Dev1 wrote:
> Hi all,
>
> I have a CXF REST WS URL that supports unknown number of query parameters.
> I get the query paramters from  uriInfo - @context uriInfo.
>
> The system requires that some of the query params cannot be not empty => the
> key and the associated value cannot be empty.
>
> I can programatically check for non-null key and value. But I want to avoid
> this approach and see if there any other approach in CXF.
>
> Thus, is there a way in CXF to restrict the REST WS user to always send
> non-empty values in the *key* and *value* of a query param?
>
> Example - If this is one of the query parameter that is being sent in the
> url   -  useName=xyz
> then both the *key* and the *value* *cannot be empty. *
>
> Hope to know your input.
>
> Thanks in advance.
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Query-params-check-tp5732539.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com