fileEncoding

Issues and Questions related to running Apache Tomcat on z/OS
Post Reply
TimHare
Posts: 6
Joined: Mon Jan 25, 2010 10:31 am
Location: Tallahassee, FL

fileEncoding

Post by TimHare »

We have IBI's WebFOCUS product. We are trying to install the client piece, which uses servlets, on TomCat on ZOS. It deploys OK but we have an encoding problem with the pages. As an example, the 'welcome' page of theirs uses frames. Frames which contain '.jsp' display OK, frames in which static .htm pages are included do not - they are ASCII representations of the EBCDIC-encoded .htm pages which are in the directories within USS.

Should I be adding
<init-param>
<param-name>fileENcoding</param-name>
<param-value>IBM-1047</param-value>
</init-param>

to the <servlet>default servlet with web.xml (I believe IBM-1047 is EBCDIC from other iconv discussions), or should I be looking for something within the application ?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: fileEncoding

Post by dovetail »

Its difficult to say without knowing more about how Tomcat and the JVM are configured.

If, you have the file.encoding System property set to ISO8859-1 (which is usually required to run Tomcat), then I would assume that your static pages will need to be in the same encoding. I don't know what the fileENcoding init-param does for the IBM web application.
TimHare
Posts: 6
Joined: Mon Jan 25, 2010 10:31 am
Location: Tallahassee, FL

Re: fileEncoding

Post by TimHare »

We have -Dfile.encoding=ISO8859-1 as is usual. In the application deployment apparently the .htm and .html files are in IBM-1047 (EBCDIC).

On IMWTTPD we had to make sure the AddType for .htm, .html, and maybe a couple of others, specified ebcdic encoding (IBM ships ebcdic as an encoding in httpd.conf and sets some things to use it by default also). What is the TomCat equivalent of AddType, do you know?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: fileEncoding

Post by dovetail »

It is impossible to say where the problem is without detailed analysis of your Tomcat and web application configuration.

For example - how is Tomcat configured to serve static pages? (what servlet is used? If it is the Tomcat DefaultServlet, then you can configure its default file encoding if different from the -Dfile.encoding (the "platform encoding"). See: http://tomcat.apache.org/tomcat-5.5-doc ... rvlet.html

Did IBI supply your Tomcat configuration (server.xml)? The web.xml? the environment variable configuration?
If so, you should probably ask them for details on how the file system should be set up. Perhaps they intend that the html files be stored in UTF-8 or ISO8859-1 on the z/OS zFS/HFS filesystem.
TimHare
Posts: 6
Joined: Mon Jan 25, 2010 10:31 am
Location: Tallahassee, FL

Re: fileEncoding

Post by TimHare »

Well, I learned one thing not to do!

I edited web.xml and changed mime-type>text/html</mime-type> to mime-type>text/html; charset=ebcdic-p-us</mime-type> for the htm and html extensions.

The Tomcat main page was then garbage. I brought Tomcat down (this is a test instance) and back up and the page is still junk... When I get a chance I will clear cache and check.
TimHare
Posts: 6
Joined: Mon Jan 25, 2010 10:31 am
Location: Tallahassee, FL

Re: fileEncoding

Post by TimHare »

Well it's somehow sending out the Tomcat root index.html as EBCDIC now. Using IE8's Encoding menu choice I changed it to UTF8 and it looked fine.

This message - "JZOSVM50(I): Using output encoding: 'IBM-1047' " only applies to STDOUT/STDERR etc. right?

Clearing cache worked for the index.html. Now, back to the other guy's EBCDIC static pages.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: fileEncoding

Post by dovetail »

Yes, this message applies to the STDOUT/STDERR from the JZOS batch launcher:

JZOSVM50(I): Using output encoding: 'IBM-1047' " only applies to STDOUT/STDERR etc. right?
Post Reply