Web application for recording blog comments
That's easy: You're repeating quite a few things, so don't do it.

disp.forward(req, resp);


This is the easiest, copied in each of the 4 branches, but needn't be. Drop the needless return and move it after the branches.

But in general, deduplication is hard and it's much better to learn to avoid duplications. Just imagine Ctrl-C and Ctrl-V are broken and you must type using one finger only. :D You could write a method accepting statusMessage and handling the problem. But it's simple enough so you can do it inline.

The basic idea is "compute the statusMessage, leave it empty in case there's no problem and handle it":

if (comment.isEmpty()) {
    statusMessage = name.isEmpty()
        ? "Name and comment fields empty"
        : "Comment field empty";
} else {
    statusMessage = name.isEmpty()
        ? "Name field empty"
        : "";
}

if (statusMessage.isEmpty()) {
    CommentBean commentBean = new CommentBean();
    commentBean.setComment(comment);
    commentBean.setName(name);
    req.setAttribute("comment", commentBean);
    disp = req.getRequestDispatcher("acknowledgement.jsp");
} else {
    disp = req.getRequestDispatcher("error.jsp");
}

disp.forward(req, resp);