Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9241729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:25:35+00:00 2026-06-18T08:25:35+00:00

I’ve got a web service in java with method FindEl(string myel) that accepts utf

  • 0

I’ve got a web service in java with method FindEl(string myel) that accepts utf – 8 string paraeter

the select query should find all the elements that start with this string
Here is the code in Java – for my web service
public class locselall
{

public String FindEl(String myel ) throws ClassNotFoundException 
{
//
    String selectQuery = "select biz_subject from pl_biz WHERE biz_subject ILIKE '"+ myel + "%'";
//get rows 
    }

And there is no problem when i type in the browser to test my web service and it i selects:

http://localhost:9091/locselall/services/locselall/FindEl?myel=СИТ

it works;


and here is the html page that sends request to the server

html>
<head>
<script>

var xmlhttp;
    if (window.XMLHttpRequest) 
    {
        xmlhttp = new XMLHttpRequest();
    } 
    else 
    {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
function triming()
{

var strInput= document.getElementById('txtInput').value;
// for example I enter "ШИФ " - utf  8 cahracters
var newstr = strInput.replace(/[^\u0400-\u04FF0-9]/gi, '');

         xmlhttp.onreadystatechange = function() 
        { 
            if (xmlhttp.readyState==4 && xmlhttp.status==200) 
            {
                alert(xmlhttp.responseText);
                //var xmlObj = xmlhttp.responseXML;   
                //var textXML = xmlObj.documentElement.firstChild.firstChild.nodeValue;

            }

        }

        var url = "http://localhost:9091/locselall/services/locselall/FindEl?myel="+ newstr;

        document.getElementById('pr').innerHTML = url;
        xmlhttp.open("GET", url, true);
        xmlhttp.send(); 


}

</script>

</head>
<body>
<input type= "text" id="txtInput"   />
<input type="button" id="btnSearch" onClick = "triming();"/>
<div id="pr"></div>


</body>
</html>

As you see i have an alert for the url and it’s exactly the same as the url which i typed in the browser to test my web service – but the response from the server is with no records selected 3


I think the problem is that my variable newstr holds utf – 8 (cyrilic )chaarcters and it’s not properly send to the server and as a result it cannot select any records!

What I’ve tried

  1. Added meta tag with charset = utf -8

nothing

  1. I read that he problem might be in my tomcat server and i added

URIEncoding = “utf-8” in the server.xml file

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" 
               URIEncoding="UTF-8"/>

Still nothing

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:25:36+00:00Added an answer on June 18, 2026 at 8:25 am

    Try using encodeURIComponent on the URL that is sent. I seem to remember seeing this issue before, where it worked with latin alphabet characters, but Cyrillic failed.

    var url = "http://localhost:9091/locselall/services/locselall/FindEl?myel=" + encodeURIComponent(newstr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a small JavaScript validation script that validates inputs based on Regex. I
Specifically, suppose I start with the string string =hello \'i am \' me And

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.