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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:48:31+00:00 2026-05-20T02:48:31+00:00

I have problem with proper charset encoding part of HTML view. XSL file in

  • 0

I have problem with proper charset encoding part of HTML view. XSL file in JSP files generates .html.
Values from database are encoded correct, but static headers of table contain wrong characters.

For example, there are headers named:
Imię, Nazwisko, Hasło, Płeć,
but it generates:
Imię, Nazwisko, Hasło, Płeć

My forHomeHtml.xml template:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml"
version="1.0">

<xsl:output method="xhtml" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />

<xsl:template match="/">
    <xsl:apply-templates />
</xsl:template>

<xsl:template match="/employees">
    <table>
        <tr>
            <th></th>
            <th>Imię</th>
            <th>Nazwisko</th>
            <th>Hasło</th>
            <th>Płeć</th>
        </tr>
        <xsl:for-each select="./employee">
            <tr>
                <td></td>
                <td>
                    <xsl:value-of select="name/text()" />
                </td>
                <td>
                    <xsl:value-of select="surname/text()" />
                </td>
                <td>
                    <xsl:value-of select="password/text()" />
                </td>
                <td>
                    <xsl:value-of select="gender/text()" />
                </td>
            </tr>
        </xsl:for-each>
    </table>
</xsl:template>

JSP site:

<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:import var="inputDocument"
url="http://localhost:8080/xyz/home.xml" />
<c:import var="stylesheet" url="/WEB-INF/xsl/forHomeHtml.xsl" />

<x:transform xml="${inputDocument}" xslt="${stylesheet}">
</x:transform>

I use Tiles, so the encoding is declared in main template:

<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<title><tiles:getAsString name="title" /></title>
...

I will add that I have encoding filter in web.xml

<filter>
  <filter-name>encodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
  </init-param>
  <init-param>
    <param-name>forceEncoding</param-name>
    <param-value>true</param-value>
  </init-param>
</filter>

<filter-mapping>
  <filter-name>encodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

Character encoding of files (JSP, XSL, XML, etc.) is setted to UTF-8.
Character encoding of the browser is setted to UTF-8.

Does anybody know the reason of that problem?


Update: It is strange, but the source of site contains following code:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-    transitional.dtd">
<html>
<head>
<title>Strona główna</title>
<style type="text/css">
.table-list {
border: 1px solid black;
border-collapse: collapse;
}
...
</style>
</head>
<body>
<table width="100%" border="0">
<tr style="background-color: #EEEEEE;">
<td><?xml version="1.0" encoding="UTF-8" ?>
<ul class="navigation_menu">
<li><a href="./home.htm">Strona główna</a></li>
<li><a href="./rejestracja.htm">Rejestracja</a></li>
<li><a href="./historia-wypozyczen-samochodu.htm">Historia samochodu</a></li>
<li><a href="./dodawanie-zamowienia.htm">Dodawanie zamówienia</a></li>
</ul>

<div style="text-align: center;">
Liczba obsłużonych dzisiaj zamówień:
0
</div></td></tr>
<tr>
<td valign="top" align="left">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE table PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-    transitional.dtd">
<table xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<tr>
<th />
<th>ImiÄ&#153;</th>
<th>Nazwisko</th>
<th>HasÅ&#130;o</th>
<th>PÅ&#130;eÄ&#135;</th>
</tr>
<tr>
<td />
<td>Zenon</td>
<td>Kowalski</td>
<td>zHasło</td>
<td>Mężczyzna</td>
</tr>
<tr>
<td /></tr>
....
<tr style="background-color: #EEEEEE;">
<td><?xml version="1.0" encoding="UTF-8" ?>
<div style="text-align: center;"></div></td></tr>
</table>
</body>
</html>

There’s no content-type header!

Should I change my Tiles template?

Btw, @Alejandro, @Jim Garrison – thanks for tips.

  • 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-20T02:48:32+00:00Added an answer on May 20, 2026 at 2:48 am

    It seems as if the JSTL is either not reading or outputting UTF-8 data correctly. I found several reports of issues with UTF-8 data and JSTL transforms, but not a lot of solutions.

    I did find this page describing a similar problem with JSTL and UTF-8 support. The solution was to switch transformers and use Saxon.

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

Sidebar

Related Questions

I have problem with setting proper charset on my jsf pages. I use MySql
i'm now starting designing with proper mark-up and organization. and now, i have problem
I have problem with checking SoapFault response from writen in PHP Soap webservice. Responce
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with ActionLink. I'd like to pass to my ActionLink parameter for
I have problem when I try insert some data to Informix TEXT column via
I do not have problem as such but I am quite new to Ruby.

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.