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

  • SEARCH
  • Home
  • 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 349913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:30:08+00:00 2026-05-12T11:30:08+00:00

I have a JSP page retrieving data and when single or double quotes are

  • 0

I have a JSP page retrieving data and when single or double quotes are in the text they are displayed as this symbol .

JSP Code:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>General</title>
    </head>
    <body>
        <h1> <%= order.getDescription %> </h1> 
    </body>
</html>

Example: An order’s description should look like this,

“20 – 4″ x 6″ widgets”

but I am getting this,

“20 – 4 x 6 widgets”

NOTE: I can not make modifications to the database.

[ EDIT ]

I used the commons-lang-2.4.jar to escape the characters and these are the primary characters giving me trouble:

  1. &#145 -> ‘
  2. &#146 -> ’
  3. &#147 -> “
  4. &#148 -> ”
  5. &#150 -> –

I am sure other characters in the some format would give me issues, however, I just did a replace on the characters for a temporary fix and I am currently testing the suggestions below.

[ CODE FOR SOLUTION ]

This probably not the best way to do it but it got the job done. The code below is in the backing bean after the the data is retrieved from the database.

description = StringEscapeUtils.escapeHtml(description);

description = description.replaceAll("&#145;", "&quot;");
description = description.replaceAll("&#146;", "&quot;");
description = description.replaceAll("&#147;", "&quot;");
description = description.replaceAll("&#148;", "&quot;");
description = description.replaceAll("&#150;", "-");

description = StringEscapeUtils.unescapeHtml(description);
  • 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-12T11:30:08+00:00Added an answer on May 12, 2026 at 11:30 am

    These are probably non-standard characters in your database…perhaps directional quotes instead of the straight up-and-down ones?

    A straight-forward way to handle this, since you can’t change the data in the database, would just be to use a replace or regex to swap out “bad” characters with ones that will display correctly.

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

Sidebar

Ask A Question

Stats

  • Questions 184k
  • Answers 184k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer you should write as: [CustomValidation( typeof( MyExtraClassValidation ), "Validate" )]… May 12, 2026 at 4:46 pm
  • Editorial Team
    Editorial Team added an answer You could define a PrintStream that prints to a JTextArea:… May 12, 2026 at 4:46 pm
  • Editorial Team
    Editorial Team added an answer That's because you are setting a negative distance that gives… May 12, 2026 at 4:46 pm

Related Questions

I want to display a list of all the users in my site but
I have a jsp page with two radio tags. The page contains a struts2
I have a JSP page running on Tomcat 5.5. I have the following code:
I have a jsp page which should load a popup using ajax. The content

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.