|
From: Bill B. <bb...@re...> - 2008-10-30 13:06:09
|
There's two ways to do this:
@PUT
public void put(@Context UriInfo uri)
{
boolean exists = uri.getQueryParameters().containsKey("doTest");
}
@PUT
public void put(@QueryParam("doTest") @DefaultValue("NOT EXISTS") String
doTest)
{
boolean exists = !"NOT EXISTS".equals(doTest);
}
Gennady Shumakher wrote:
> Hi,
>
> I wonder whether it is possible to identify the @QueryParam existence
> regardless of the parameter value.
> I mean suppose I want to have service uri to be .../myService?doTest where
> 'doTest' is optional.
> Annotating the method with @Param("doTest") will inject the parameter value
> if parameter is passed or default if it is not, but is there a way to
> differentiate between the cases?
>
> Thanks,
> Gennady
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> 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
|