JSTL, JSP, Struts. Do I have to use UTF-8 encoding?

E

eeyimaya

Hi,

I am developing a web application in Turkish, with java and
encountered some encoding problems.

I think, I have to encode all my pages with utf-8 if I read my
contents from files(XML, ApplicationResources.properties... etc).???

When I used struts; I keep all my labels and messages in
ApplicationResources.properties file but Turkish characters are not
displayed even I used a filter that sets the encoding to ISO-8859-9. I
used the following to read from ApplicationResources.properties:
<bean:message key="link.employee.helloWorld"/>

When I used JSTL to read xml files, again Turkish characters are not
displayed.
I read XML with the following:

<c:import var="xml" url="/conf/menu.xml" />
<x:parse var="dom" doc="${xml}" />
.....
<x:forEach var="menu" select="$dom/firma/menu" varStatus="status">
<x: out select="./@id" />
.....
</x:forEach>
......


I tried native2ascii tool with my struts application and problem is
solved. But since this is very tiring.(well, at least not practical
because my application is not an I18N application. only Turkish), I
did not try for JSTL.

So, I have 4 ways:

1) I don't use java (I want to use java)
2) I don't use xml, ApplicationResources.properties... files and write
my application as hard-coded.(very bad. I want to use design patterns)
3) I use native2ascii tool and convert my files to utf-8.(I don't know
if it works for JSTL but for struts it is an impractical solution)
4) I don't use JSTL, struts and only servlets and jsp.( then, why
these exist if they can't handle even a simple encoding)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top