Question: I want to use a java class in JSP. I placed the java class file in `WEB-INF/classes/hello.class.`

In `index.jsp` i'm creating the object for `hello` class.

I'm getting this error `"hello cannot be resolved to a type"`. Here is my jsp code,

```
<%@ page import="hello" %>
<%
    hello h = new hello();
    out.print(h.getValue());
%>

```

Answer: 
Emacs comes with the command `comment-box` for this purpose. It produces centered comment boxes, although the width of the box varies depending on the content. E.g., with the region set around the following line:

```
This is a comment

```

when you call `M-x comment-box` the text is transformed to:

```
;;;;;;;;;;;;;;;;;;;;;;;
;; This is a comment ;;
;;;;;;;;;;;;;;;;;;;;;;;

```

I use a modifed version that places the comment box around the current line if the region isn't active, and then steps out of the comment afterwards. It also temporarily reduces the fill-column, so the comment box is not wider than your longest line:

```
(defun ty-box-comment (beg end &optional arg) 
  (interactive "*r\np")
  (when (not (region-active-p))
    (setq beg (point-at-bol))
    (setq end (point-at-eol)))
  (let ((fill-column (- fill-column 6)))
    (fill-region beg end))
  (comment-box beg end arg)
  (ty-move-point-forward-out-of-comment))

(defun ty-point-is-in-comment-p ()
  "t if point is in comment or at the beginning of a commented line, otherwise nil"
  (or (nth 4 (syntax-ppss))
      (looking-at "^\\s *\\s<")))

(defun ty-move-point-forward-out-of-comment ()
  "Move point forward until it's no longer in a comment"
  (while (ty-point-is-in-comment-p)
    (forward-char)))

```
The question was whether it is possible in emacs-lisp. Yes it is. There are several ways to do it.
I will show one way where you can also comment several lines of text.
Maybe, in the first line there is the title of the part of text and in the second one there is the author of this part.

A better way would be to advice `LaTeX-indent-line` function. This way you could edit the comment text and re-indent. When I find time I will show you also this variant.

Usage: Write your comment as clear text. Mark text as region with the mouse and then run the following command.

```lisp
(defun LaTeX-centered-comment (b e)
  "Convert region into centered comment."
  (interactive "r")
  (let* ((n (count-lines b e)))
    (goto-char b)
    (beginning-of-line)
    (insert-char ?% fill-column)
    (insert ?\n)
    (setq b (point))
    (center-line n)
    (goto-char b)
    (loop for i from 1 upto n do
      (replace-region (point) (+ (point) 3) "%%%")
      (end-of-line)
      (insert-char ?\  (max 0 (- fill-column (- (point) (line-beginning-position)) 3)))
      (insert "%%%")
      (forward-line))
    (insert-char ?% fill-column)
    (insert ?\n)
    ))

```