Java Reference
In-Depth Information
Figure 8.4: The Message Details page
8.4
Using Cross-page Controls
The Message Details page (shown in Figure 8.4 ) appears when the user
clicks a message subject on the Message List page. There's nothing
spectacular about the Message Details page, but what's interesting is
that the controls at the bottom are the same as in the Message List
page; the only difference is that deleting or moving to a folder applies
to the currently displayed message rather than a series of messages
checked off in the Message List page. Let's see how we can define the
controls in one place and reuse them in these two different contexts.
We'll start by putting the controls in a separate JSP ( message_action.jsp )
under the common directory since it's being used in more than one
place:
Download email_19/web/WEB-INF/jsp/common/message_action.jsp
<jsp:useBean class="stripesbook.view.FoldersViewHelper" id="folders"/>
<div id="action">
<s:submit name="delete" value="Delete"/>
Move to folder:
<s:select name="selectedFolder">
<s:option value=""> Select a folder... </s:option>
<s:options-collection collection="${folders.folders}"
value="id" label="name"/>
</s:select>
<s:submit name="moveToFolder" value="Move"/>
<s:errors field="selectedFolder"/>
</div>
This code will be included in message_list.jsp and message_details.jsp with
the <%@include%>
directive. Unlike <jsp:include/>,
<%@include%>
 
 
 
Search WWH ::




Custom Search