Итак, данные из формы прямиком заносятся в базу данных. Это плохо, да?
Сделал так:
Форма:
<form method="POST" action="<%= request.getContextPath() %>/comment" accept-charset="UTF-8">
<legend>Оставить комментарий</legend>
<input type="hidden" id="id" name="id" value="${id}">
<input type="text" id="name" name="name" class="span4" placeholder="Псевдоним" />
<textarea id="comment" name="comment" class="span4" rows="3" placeholder="Комментарий"></textarea>
<button type="submit" name="submit" class="btn">Отправить</button>
</form>
            int id = Integer.parseInt(request.getParameter("id")); // там может быть только int, инфа 100%
            String postName = request.getParameter("name");
            String postComm = request.getParameter("comment");
            String postAddr = request.getRemoteAddr();
            /* ... */
            String sql = "INSERT\n"
                        + "INTO `comments`\n"
                        + "(`id`, `name`, `ip`, `text`) VALUES\n"
                        + "(" + id + ",\n"
                        + "'" + postName + "',\n"
                        + "INET_ATON('" + postAddr + "'),\n"
                        + "'" + postComm + "');";
            /* ... */
            connectToDatabase().executeUpdate(sql);








