Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在控制器Java中操作成功后,如何在屏幕上显示成功消息?_Java_Html_Model View Controller - Fatal编程技术网

在控制器Java中操作成功后,如何在屏幕上显示成功消息?

在控制器Java中操作成功后,如何在屏幕上显示成功消息?,java,html,model-view-controller,Java,Html,Model View Controller,我在控制器中有一个动作,当点击按钮时,它会发送电子邮件。我想向用户显示一条消息,以便在发送所有电子邮件时通知他们 @Action(value = "sendRequest", results = { @Result(name = SUCCESS, location = "mail.jsp"), @Result(name = ERROR, location = "mail.jsp")}) public class

我在控制器中有一个动作,当点击按钮时,它会发送电子邮件。我想向用户显示一条消息,以便在发送所有电子邮件时通知他们

@Action(value = "sendRequest", results = { @Result(name = SUCCESS, location = "mail.jsp"),
            @Result(name = ERROR, location = "mail.jsp")})
public class MailController {

    public String sendMails() {

        //code where the mails are sending to users

        return SUCCESS;
    }
}

只需抛弃JSP(只要您不必使用它,因为您的应用程序是遗留的),然后切换到JSF。我必须使用JSP,这就是项目的开发方式。您在这里为MVC?Spring框架使用什么库
<div>
    <span class="button"><input type="button"
    id="_mailAll" class="buttonMails" value="Send" /></span>
</div>
$('#_mailAll').click(function () {
        var form = $('#_dashboardForm') ;
        form.attr('action', 'sendEmails.action');
        form.submit();
});