*
* @param destination
* The page that the user will be taken to upon a successful submission (in case this is not via the "apply" button.)
*/
public static HttpResponseException success(final String destination) {
return new HttpResponseException() {
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException {
if (isApply(req)) {
// if the submission is via 'apply', show a response in the notification bar
applyResponse("notificationBar.show('"+Messages.HttpResponses_Saved()+"',notificationBar.OK)")
.generateResponse(req,rsp,node);