0

I,ve got the problem with 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); // this string is for checking the value of returning parameter
            list = bookList.getBooksByGenre(genreId);

        } else if (request.getParameter("letter") != null) {
            String letter = request.getParameter("letter");
            System.out.println(letter);// this string is for checking the value of returning parameter
            session.setAttribute("letter", letter);
            list = bookList.getBooksByLetter(letter);
        } 
    %>

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

Thanks everybody!

P. S. Browser prints the proper book list when I choose "genre" and prints empty list when I choose the russian "letter". I check the quote with the "letter" in my MySql base using inner sql quote - it works properly.

Dionisius1976
  • 107
  • 1
  • 1
  • 7

0 Answers0