Home > Default > Content-type problems while using struts+tomcat+apache+mod_jk

Content-type problems while using struts+tomcat+apache+mod_jk

December 10Hits:3
Advertisement
Hi!
Could anyone tell me how to solve the following problem.
Struts-application works under apache + mod_jk + tomcat 3.3.1. Operating system is Linux.
It's impossible to me to make tomcat to send HTTP-answers in UTF-8.
I was trying the following:
1. Set <DecodeInterceptor defaultEncoding="UTF-8" /> in server.xml
(Has no effect. Tomcat responds with Content-Type: text/html; charset=iso-8859-1)
2. Insert <%@ page contentType="text/html; charset=utf-8"%> into each page header.
(Works fine but when struts-application gets GET/POST-data the two-bytes national characters
are comverted into "?"-symbols)
Is there any way to make tomcat 3.3.1 to send HTTP-answers in UTF-8?

Answers

I don't know what the DecodeInterceptor does... but....
If you use number 2, you are only telling the browser what that page's output is. When you process the data, Tomcat for some reason always reads it as ISO8895-1, so you need to tell Tomcat to change it to UTF-8. You can do that by calling request.setCharacterEncoding("UTF-8"), either in the JSP page, or if you need it in a servlet, you can do that in a filter...
It's somewhat described here how to set it up...
http://www.mail-archive.com/[email protected]/msg01193.html

Read other 2 answers

Tags:

Related Articles

  • Content-type problems while using struts+tomcat+apache+mod_jkDecember 10

    Hi! Could anyone tell me how to solve the following problem. Struts-application works under apache + mod_jk + tomcat 3.3.1. Operating system is Linux. It's impossible to me to make tomcat to send HTTP-answers in UTF-8. I was trying the following: 1.

  • Extended Content type problemNovember 30

    Extended Content type problem I want to extend the content type 'ExtendDocument' from 'Document'. So I use 'Oracle Internet File System Manager' to create a new Class Object named 'EXTENDDOCUMENT', which is extend from 'DOCUMENT', and add a attribute

  • Content type problem for 'does not appear to be a proper arcive'October 11

    Hi all, The following code will create a ZipOutputStream using ByteArrayOutputStream (not FileOutputStream) and attach the outputstream to a MIME multipart email using ByteArrayDataSource (so the file never exists physically). It works and sends the

  • Content-Type problemsNovember 30

    Hi, Can anyone tell me the difference in application/x-www-form-encoded and application/x-www-form-urlencoded content types in HTTP ? Thanks in advance!I don't know what the DecodeInterceptor does... but.... If you use number 2, you are only telling

  • Could not write value Content Type problem when installing itunes 08. help!November 30

    When I tried to update itunes 08 there was an error. Instead, I uninstalled and downloaded the itunes8 setup. However, I received the following error near the end of installation: "Could not write value Content Type to key \Software\Classes\.aif. Ver

  • Content Type problemNovember 30

    I am trying to retrieve the content type of a file. String strContentType ="";           File file = new File(fileName);           FileNameMap  fnmMime        = URLConnection.getFileNameMap ( ) ;            if ( fnmMime != null ) {             

  • Sharepoint 2013 and SSRS 2012 Integration - Report Server Content Types not displayedOctober 11

    Hello, Everyone:   I installed SSRS 2012 on our Sharepoint 2013 application server following the step-by-step instruction from the posting below:   http://msdn.microsoft.com/en-us/library/jj219068.aspx   Everything goes well after STEP 3 is completed

  • Problem with content typeOctober 11

    Hi All, I have set the content type to text/html by using the following statement in jsp <%@page contentType=�text/html�%>And if I give out.println("<a href="aaa.do">Click here</a>"); it is showing me a link to click

  • Tomcat always generates charset in Content-Type http header !!!October 11

    Dear All! I need urgent help with a problem I met with and any suggestion are very appreciated! The problem is: We are using Tomcat as a web server (and JSP engine), and we would like to use a user control written in C# 2.0 on one of our pages. I've

  • XML Parser and Content-type/encoding problemOctober 11

    I've write a little and simple XML parser and a simple "trasformer" that recive an XML file and an XSL one and return HTML, here is the code: public static String toHTML(Document doc, String xslSource){         ByteArrayOutputStream testo = new

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.591 s.