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

Discussion in 'Java' started by eeyimaya, Mar 2, 2005.

  1. eeyimaya

    eeyimaya Guest

    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)?
    eeyimaya, Mar 2, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert Mark Bram

    Custom JSTL that accepts JSTL expression

    Robert Mark Bram, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    965
    Robert Mark Bram
    Dec 15, 2004
  2. rbondi
    Replies:
    0
    Views:
    550
    rbondi
    Aug 3, 2007
  3. DaFoot
    Replies:
    1
    Views:
    1,678
    DaFoot
    Oct 23, 2008
  4. Replies:
    2
    Views:
    378
    Nathan Keel
    Aug 14, 2009
  5. ConligoSoft GmbH
    Replies:
    1
    Views:
    150
    ConligoSoft GmbH
    Apr 21, 2005
Loading...

Share This Page