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 6026453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:26:51+00:00 2026-05-23T04:26:51+00:00

My servlet looks like this protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException { PrintWriter

  • 0

My servlet looks like this

  protected void processRequest(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
  {
    PrintWriter out=response.getWriter();

    out.println("<Html><Head><Title>Signup</Title></Head>\n<Body>\n");
    out.println("\u5982 电话\n");
    out.println("</Body>\n</Html>");
  }

My browser can display Chinese characters from other websites.
I’m trying 2 different ways to display Chinese characters, but they all showed up as ???
What’s the correct way to do it ?

  • 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-05-23T04:26:51+00:00Added an answer on May 23, 2026 at 4:26 am

    No explicit encoding has been set for the response. The response would therefore be written by the container with the default encoding of ISO-8859-1.

    You’ll therefore need to specify the appropriate character encoding using the HttpServletResponse.setCharacterEncoding() or HttpServletResponse.setContentType methods. This would be either of:

    response.setCharacterEncoding("GB18030");
    response.setContentType("text/html; charset=GB18030");
    

    You may also use UTF-8 as the explicit encoding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My servlet function looks like these: CODE: protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
I have a servlet that looks like this: public void doPost(HttpServletRequest request, HttpServletResponse response)
My ImageDAO looks like this: public InputStream getPhotos(Long userid) throws IllegalArgumentException, SQLException, ClassNotFoundException {
I have Servlet that looks something like this: public class MyServlet extends Servlet {
Suppose my Tomcat webapps directory looks like this: webapps/ webapps/fooapp/ webapps/fooapp/WEB-INF/ webapps/fooapp/WEB-INF/web.xml webapps/fooapp/bardir/ When
There's a piece of code that looks like this. The problem is that during
Okay, so say I have a class that looks like this : public class
I have simple web application based on JSP. Root of application looks like this:
I have a datasource set in my Jetty.xml file that looks like this: <New
How can I access HTTP headers in Spring-ws endpoint? My code looks like this:

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.