Answer the question
In order to leave comments, you need to log in
Why does request.getParameter result in ?????? instead of UTF-8?
Hello.
there is JSP code
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %>
<c:set var="selected_region" value='<%= request.getParameter("selected_region") %>'/>
<c:set var="SCRIPT">
select solution, position
from employee t1,region t2
where region='${selected_region}'
</c:set>
<sql:query var="rs_employees" dataSource="jdbc/oracle">
${SCRIPT}
</sql:query>
${selected_region}
<json:object>
<json:array name="employees" var="row" items="${rs_employees.rows}">
<json:object>
<json:property name="solution" value="${row.solution}"/>
<json:property name="position" value="${row.position}"/>
</json:object>
</json:array>
</json:object>
Answer the question
In order to leave comments, you need to log in
solved the problem by adding
<%
request.setCharacterEncoding("UTF-8");
%>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question