In case anyone's interested, I solved the problem by making a small
compromise:  that previewing a post (whether a new one or an edited one)
should require the same security authorization as posting one.

>From that point on, I can limit myself to two action mappings: dispatchPost,
editPost

Those two mappings correspond to two separate actions:  DipatchNewPost,
DispatchEdit.  Each action has its own preview() method.  (In fact, the
preview() method is inherited in each case from an abstract superclass.)

Clicking the "Preview" button calls the preview() method.


2008/8/9 Pierre Thibaudeau <[EMAIL PROTECTED]>

> I have a "posting" form (in JSP) which is used for any of the following:
> * Posting a new comment
> * Editing an existing comment
> * Previewing a new comment
> * Previewing a comment while it's being edited.
>
> I have a DispatchPost action with three methods: newPost(), editPost(),
> preview().
>
> The form has two buttons:  "Post" and "Preview".  Clicking "Preview" should
> call the preview() method (which will forward back to the same JSP).
> Clicking "Post" should call either the newPost() method or the editPost(),
> depending on the null-ity of various hidden fields;  the JSP form can
> distinguish internally between those two options.
>
> The problem arises with respect to the various security interceptors.  A
> dispatchNewPost action requires a different set of interceptors than a
> dispatchEditPost action.  Therefore, I need to label them separately in
> struts.xml (interceptors not displayed):
>
> <action name="dispatchNewPost" class="com.actions.DispatchPost"
> method="newPost"/>
> <action name="dispatchEditPost" class="com.actions.DispatchPost"
> method="editPost"/>
>

Reply via email to