html
1<textarea name="freeword" rows="3" cols="10" wrap="hard"></textarea>
のようにwrap="hard"属性をつけることで、テキストエリアに改行をいれた場合、改行つきで送信します。
受け側のサーブレットなどでは、以下のようにすれば良いでしょう。(Windows環境)
環境により改行文字が異なりますのでご注意ください。
java
1protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
2 String textarea = request.getParameter("freeword");
3
4 int position = textarea.indexOf("\r\n");
5
6 log("position :" + position);
7}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。