Sitemap

Amicuk Programming Answers

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

2015-12-10   Views:0

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.

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?

The replay answer
Advertisement
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

Go to See the other 2 answers

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

Category:DefaultRelease time:2015-12-10Views:130

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.[More]

Extended Content type problem

Category:DefaultRelease time:-0001-11-30Views:130

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[More]

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

Category:DefaultRelease time:2015-10-11Views:130

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[More]

Content-Type problems

Category:DefaultRelease time:-0001-11-30Views:130

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[More]

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

Category:DefaultRelease time:-0001-11-30Views:130

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[More]

Content Type problem

Category:DefaultRelease time:-0001-11-30Views:130

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 ) {             [More]

Sharepoint 2013 and SSRS 2012 Integration - Report Server Content Types not displayed

Category:DefaultRelease time:2015-10-11Views:130

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[More]

Problem with content type

Category:DefaultRelease time:2015-10-11Views:130

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

Tomcat always generates charset in Content-Type http header !!!

Category:DefaultRelease time:2015-10-11Views:130

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[More]

XML Parser and Content-type/encoding problem

Category:DefaultRelease time:2015-10-11Views:130

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[More]

Problems when trying to return information for External Content Types in Sharepoint 2013

Category:DefaultRelease time:2015-10-11Views:130

This is my first post on the forum, until I tried on this problem but have not found anything. When trying to return the information from the external content displays the following error: Error retrieving data from mill. Administrators: query the se[More]

Hot
I have a 30gb Photo iPod and a 1.42 MHZ G4 mac mini. I plugged in the iPod over fire wire and then the iPod loaded the first time. The second time i plugged it in the iPod froze and would so did my computer until i unplugged it by force. Then i plugg [More]
hi All, I Have an Scenario where i am using BPM. Most of the blog tells about manually creating all Configuration objects. I had created an Integration Scenario for this scenario by referring to the earlier threads available for same. Hoe to Create I [More]
Our application experiences a segmentation fault and dumps core when executed on machines patched with recent versions of SunOS 5.8 linker patch 109147. The coring occurs with versions 18 through 35 of patch 109147. Coring does not occur with version [More]
I bought an external drive to backup my Mac and my Pc. It is formatted as Fat32, acceptable both to Mac and Pc. When I tried to use Time Machine it asks to format the external drive -- which means it will be formatted for Mac only. Is there a way to [More]
I have a formula which checks a list of domains to see what the TLD is and then returns a renewal price based on the TLD e.g. .co.uk may return with $5.99 and .com $10.00. The formula I am using is below: =VLOOKUP(RIGHT(A2,LEN(A2)−SEARCH(".",A2) [More]
I get this message when I try to install AdobeAir: "Unable to Install/Uninstall AdobeAir.Contact Administrator." I am the Administrator! Has anyone else got this message? My OS is Windows vista.Hi Make sure we loged in as admin and then we need [More]
Is there a way to preserve RGB colors in a PDF/X document? I always believed a PDF/X-3 allows RGB colors, but does flatten transparency. I tried that but all RGB colors become CMYK, even with "no color conversion" set in the output tab. We need [More]
This is weird...I tried logging onto the iTunes store using my AOL login ID and password, but it throws up a message saying that the username and/or password is incorrect. It was working fine up until yesterday. I further checked to see if AOL (www.a [More]
Just finished recording/matering new album.  In iTunes it distorts ALL to piece but in Quicktime it sounded perfect.  Took me FOREVER to figure out but iTunes defaults to an Equalizer setting (at least mine did).  Once I turned off the Equalizer it f [More]
I have Time Machine set up on a USB external hard drive. I have noticed that if the drive in the Time Machine has spooled down, my iMac won't respond to the mouse or keyboard until that drive spools up again. This takes only a second or two, but is t [More]