InsertPostingAction

Creates a Forum plug-in posting from the information submitted in a PostingForm. When the action is completed, it forwards the request to the URL specified in the form's 'targetUrl' property. If the request fails or the user clicks Cancel, the action is instead forwarded to URL specified in the form's 'errorUrl' or 'cancelUrl' property as appropriate. Note that this action class has a protected method with the signature 'protected int getSectionId(final HttpServletRequest pRequest, final PostingForm pForm);'. You can call this method to find out whether or not the new posting is to be added to any additional section. The method returns either a valid section ID or -1. If it returns -1 then the posting will not be added to any extra sections, only the forum home section.

Struts config
<action path="/forum/createPosting"
  type="com.escenic.forum.struts.presentation.InsertPostingAction"
  name="com.escenic.forum.struts.presentation.PostingForm"
  input="/forum/createPosting-input.jsp"
  validate="true">
</action>
Action Form

This action can be used with the following form:

com.escenic.forum.struts.presentation.PostingForm

The form contains the posting to be added to the forum. The form's 'targetUrl' field is particularly important because it contains the URL to which the request is to be redirected after the posting has been added.

Action Forwards

If no errors occur adding the posting, the request is forwarded to the URL specified in the form's 'targetUrl' field. A 'postingId' parameter containing the numeric ID of the new posting is appended to the forwarded request. If the user clicks the form's 'Cancel' button, then the request is forwarded to the URL specified in the form's 'cancelUrl' field. If an error occurs, then the request is forwarded to the URL specified in the form's 'errorUrl' field.

Action Error

The pseudo-properties 'user' and 'developer' are used to classify errors as user error or developer errors. User errors should be handled in such a way as to allow the user to recover, while developer errors can be considered fatal. Note that if the 'errorUrl' property is not set, then an 'IllegalArgumentException' will be thrown, which will usually produce a stack trace.

forum.user.postingAlreadySubmitted

(On the user property.) If the posting has been submitted already (typically the user clicked reload in the browser, trying to resubmit the same posting).

forum.user.generic.error

(On the user property.) If there is a fatal error when trying to add the posting.

forum.error.server

(On the developer property.) If there is a fatal error when trying to add the posting.