@Path("/greet")
@RequestScoped
public class GreetResource
extends java.lang.Object
| Constructor | Description |
|---|---|
GreetResource(java.lang.String greetingConfig) |
Using constructor injection to get a configuration property.
|
| Modifier and Type | Method | Description |
|---|---|---|
javax.json.JsonObject |
getDefaultMessage() |
Return a wordly greeting message.
|
javax.json.JsonObject |
getMessage(java.lang.String name) |
Return a greeting message using the name that was provided.
|
javax.json.JsonObject |
updateGreeting(java.lang.String newGreeting) |
Set the greeting to use in future messages.
|
@Inject public GreetResource(java.lang.String greetingConfig)
greetingConfig - the configured greeting message@Path("/")
@GET
@Produces("application/json")
public javax.json.JsonObject getDefaultMessage()
JsonObject@Path("/{name}")
@GET
@Produces("application/json")
public javax.json.JsonObject getMessage(@PathParam("name")
java.lang.String name)
name - the name to greetJsonObject@Path("/greeting/{greeting}")
@PUT
@Produces("application/json")
public javax.json.JsonObject updateGreeting(@PathParam("greeting")
java.lang.String newGreeting)
newGreeting - the new greeting messageJsonObjectCopyright © 2018 Oracle Corporation. All rights reserved.