@Loggable(value=1) public final class FlashInset extends Object implements Inset
BasePage,
Flash messages in RESTful interfaces| Modifier and Type | Class and Description |
|---|---|
static class |
FlashInset.Flash
The cookie.
|
Inset.Default, Inset.Runtime| Constructor and Description |
|---|
FlashInset(Resource res)
Public ctor.
|
| Modifier and Type | Method and Description |
|---|---|
static JaxbBundle |
bundle(Level level,
String msg)
Make a bundle.
|
static JaxbBundle |
bundle(Level level,
String msg,
long msec)
Make a bundle.
|
static javax.ws.rs.WebApplicationException |
forward(URI uri,
Exception cause)
Throw an exception that will forward to the page with an error message.
|
static javax.ws.rs.WebApplicationException |
forward(URI uri,
String message,
Level level)
Create an exception that will forward to the page with an error message.
|
javax.ws.rs.WebApplicationException |
redirect(URI uri,
Exception cause)
Create an exception that will redirect to the page with an error message.
|
javax.ws.rs.WebApplicationException |
redirect(URI uri,
String message,
Level level)
Create an exception that will redirect to the page with an error message.
|
void |
render(BasePage<?,?> page,
javax.ws.rs.core.Response.ResponseBuilder builder)
Render it into the response builder.
|
public FlashInset(@NotNull
Resource res)
res - The resourcepublic void render(@NotNull
BasePage<?,?> page,
@NotNull
javax.ws.rs.core.Response.ResponseBuilder builder)
Insetpublic static JaxbBundle bundle(@NotNull Level level, @NotNull String msg, long msec)
level - Logging levelmsg - Messagemsec - Time spentpublic static JaxbBundle bundle(Level level, String msg)
level - Logging levelmsg - Messagepublic javax.ws.rs.WebApplicationException redirect(@NotNull
URI uri,
@NotNull
String message,
@NotNull
Level level)
The difference between this method and a static
forward(URI,String,Level) is in its awareness of a resource,
which is forwarding. Key benefit is that a non-static method adds extra
value to the cookie, which is time consumed by the resource until the
redirect happened.
uri - The URI to forward tomessage - The message to show as errorlevel - Message levelpublic javax.ws.rs.WebApplicationException redirect(@NotNull
URI uri,
@NotNull
Exception cause)
The difference between this method and a static
forward(URI,Exception) is in its awareness of a resource,
which is forwarding. Key benefit is that a non-static method adds extra
value to the cookie, which is time consumed by the resource until the
redirect happened.
uri - The URI to forward tocause - The cause of this problempublic static javax.ws.rs.WebApplicationException forward(@NotNull
URI uri,
@NotNull
String message,
@NotNull
Level level)
uri - The URI to forward tomessage - The message to show as errorlevel - Message levelCopyright © 2011–2014 ReXSL.com. All rights reserved.