Hi,
I am using query param for method. I want to specify the Default value for
that query param. If I specify a constant string, then it is fine. But how
can I specify a runtime value as the default value?
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
@Path( "Hello" )
public class HelloWorld
{
private String defaultValue = "Default";
@GET
@Produces( MediaType.APPLICATION_XML )
public String greet( @QueryParam( "User" ) @DefaultValue( "defaultValue"
) String userName )
{
String returnValue = "Hello " + userName;
System.out.println( returnValue );
return returnValue;
}
}
Instead of a constant how can I use a variable here? Is it possible at all?
Regards,
Paul
--
View this message in context: http://jersey.576304.n2.nabble.com/How-can-I-specify-a-Default-value-dynamically-tp6842903p6842903.html
Sent from the Jersey mailing list archive at Nabble.com.