First off, this is a question for the Struts User list, rather than Struts Dev. The Dev list is for discussion of the development of Struts itself, while the User list is for discussion of building applications with Struts.
Your description below sounds confused. The content type "application/msexcel" is not a text format, it's a binary Excel spreadsheet, so you can't mix other content (e.g. HTML elements) in with it in the response. Also, adding a charset to the content type is not appropriate. If you have follow-up questions, please post them to the User list. -- Martin Cooper On 2/8/06, freaky fashion <[EMAIL PROTECTED]> wrote: > > Hello All, > I am facing an issue in the excel download,which displays the > asian characters retrieved from a database. > If the excel download has around 200rows,the chinese > characters are printed correctly. If it exceeds 250 rows the chinese > characters are printed as junk one (视é¢'). > The excel download is done in the following env, > Struts,Apache tomcat. > The flow is as mentioned below. > UI - > Action class - > DAO -> DAOImpl - > > Inside DAOImpl,we have the following code. > > 1.HttpServletResponse response = > (HttpServletResponse) argList.get(0); > response.setContentType("application/msexcel;charset=UTF-8"); > > 2.out.write(getBytes("<td>"+questionResponse+"</td>")); > > 3.getBytes(String str) is a private method which converts the string to > byte array. > > Following are the alternatives I tried with : > > 1. Tried with a filter setup,just to ensure that the character encoding is > not missed at any point of time during the request and response. (didn't > work out). > > 2.Instead of directly writing to the servletoutputstream, created a > wrapper and tried writing the data to the wrapper. (didn't work out). > > 3.Thought it might be because of the characters length and tried > truncating them too,but in vain. > > > Appreciate if you could help me to over come this issue. > > Thnx > Joe > > > --------------------------------- > Brings words and photos together (easily) with > PhotoMail - it's free and works with Yahoo! Mail. >