@Path(value="/managedbean/singleton") @Singleton public class ManagedBeanSingletonResource extends Object
| Constructor and Description |
|---|
ManagedBeanSingletonResource() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteWidget(int id)
Remove widget with given id.
|
String |
getException()
Throw a runtime exception, so that it could be mapped.
|
String |
getMessage()
Provide textual representation of the internal counter.
|
String |
getWidget(int id)
Get JPA widget value.
|
void |
putMessage(int i)
Reset internal counter.
|
void |
putWidget(int id,
String val)
Set new widget value.
|
@GET @Produces(value="text/plain") public String getMessage()
@PUT @Produces(value="text/plain") public void putMessage(int i)
i - new counter value to be set.@Path(value="exception") public String getException()
@Path(value="widget/{id: \\d+}")
@GET
public String getWidget(@PathParam(value="id")
int id)
id - widget id.@Path(value="widget/{id: \\d+}")
@PUT
public void putWidget(@PathParam(value="id")
int id,
String val)
id - widget id.val - new value to be associated with above specified id.@Path(value="widget/{id: \\d+}")
@DELETE
public void deleteWidget(@PathParam(value="id")
int id)
id - id of the widget to be removed.Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.