html - java getParametr() returns wrang value of russian char -


i,ve got problem returning "letter" (russian chars) value.

the request string is: http://localhost:8080/library_1/pages/books.jsp?letter=Г

// books.jsp

<%@page contenttype="text/html" pageencoding="utf-8"%>  <!doctype html>  <%@include file="../web-inf/jspf/left_menu.jspf" %>  <jsp:usebean id="booklist" class="beans.booklist" scope="page"/>  <%@include file="../web-inf/jspf/letters.jspf" %>  <div class="book_list">     <%         list<book> list = null;          if (request.getparameter("genre_id") != null) {             long genreid = long.valueof(request.getparameter("genre_id"));             system.out.println(genreid); // string checking value of returning parameter             list = booklist.getbooksbygenre(genreid);          } else if (request.getparameter("letter") != null) {             string letter = request.getparameter("letter");             system.out.println(letter);// string checking value of returning parameter             session.setattribute("letter", letter);             list = booklist.getbooksbyletter(letter);         }      %> 

so, if choose (russian) letter in console "??" value instead of "Г", if choose genre_id (http://localhost:8080/library_1/pages/books.jsp?genre_id=1) right value "1" in console.

thanks everybody!

p. s. browser prints proper book list when choose "genre" , prints empty list when choose russian "letter". check quote "letter" in mysql base using inner sql quote - works properly.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -