Hi,
I am trying to call servlet using Ajax request in Post method which simply return Hello in Hebrew and I am keep getting gibbrish.
I use the following code lines :
1. On the top o the JSP page -
<%@page language="java" pageEncoding="UTF-8" contentType="text/html;UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2. In the Ajax request –
ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
3. In the servlet –
response.setContentType("text/html; charset=UTF-8");
Is anyone can help?

Paste the entire servlet code which you are using.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.