Java Reference
In-Depth Information
You usually don't need to implement the Resolution interface yourself;
most of the time you'll find a ready-to-use Stripes implementation that
does what you need:
ForwardResolution
Forwards to a path, such as a JSP, or to another action bean.
RedirectResolution
The same as a ForwardResolution but uses a client-side redirect
instead of a forward.
StreamingResolution
Streams data directly back to the client, for example, to produce a
binary file.
JavaScriptResolution
Converts a Java object to JavaScript code that is sent back to
the client and is suitable for decoding using the JavaScript eval ( )
function. This is particularly useful when using Ajax.
ErrorResolution
Sends an HTTP error message back to the client, using a status
code and an optional error message.
That gives you an idea of what types of resolutions are provided by
Stripes. We'll discuss them in more detail as we use them in examples.
Running the Example
To run the example, package the web application that you've so dili-
gently created, and deploy it to your servlet container. Or, if you have
just been reading along without typing anything, you can always take
the easy way out and use the topic's source code. Just go to the get-
ting_started subdirectory of the source code bundle, and run ant . The
example will be packaged into a WAR file, ready to be deployed. After
starting your servlet container, use http://localhost:8080/getting_started to
run this chapter's example. 4 You should see the page shown in Fig-
ure 2.2 , on page 27 . Try clicking the links to change the displayed date
and time.
4. Open the index.html file in the root directory of source code bundle to get an index of
all the examples.
 
 
Search WWH ::




Custom Search