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: 
Here's a yasnippet that you can use:

```
# -*- mode: snippet -*-
# name: huge_comment
# key: hc
# --
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%${1:$(repeat-char (- 33 (/ (length yas-text) 2)) " ")}$1${1:$(repeat-char (- 74 (length yas-text) (- 33 (/ (length yas-text) 2))) " ")}%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
$0

```

How to use it: type `hc`, call `yas-expand` and start typing the text. It will re-center itself
automatically.

This snippet will work from `latex-mode` or `text-mode`. I've noticed however a bug that
messes up the cursor position if you're using AUCTeX. In that case, you can momentarily switch
to `text-mode`.
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)
    ))

```