Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JXL with weblogic

 
nuthan kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,
I am facing problems with XL file creation using JXL and weblogic, where as same code is working fine in Tomcat server. In weblogic its putting non readable characters. there is no differenct in UTF character seeting in both the server. Please let me know is there any other setting I need to worry about.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you explicitly setting Unicode as the file encoding? If not, the platform default encoding will be used, which may be a different on the WebLogic machine than on the Tomcat machine.
 
nuthan kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am running both servers (tomcat and weblogic) in same windows system.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't WebLogic use the BEA JVM? It could conceivably use a different encoding than the JVM Tomcat uses; check the "file.ecoding" system property on both.
 
nuthan kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, BEA also using same JVM as tomcat .. and in both servers file.encoding system property is Cp1252
 
nuthan kumar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the problem, there is not issue with XL file generation, but downloading file giving problem. I am using following content type in the jsp file

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition","attachment;filename=\""+filename+"\"");
 
fengting shen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nuthan kumar wrote:I found the problem, there is not issue with XL file generation, but downloading file giving problem. I am using following content type in the jsp file

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition","attachment;filename=\""+filename+"\"");


Hi,nuthan

Have you solved this problem? I have the exact problem as you met and feel so depressed..

 
fengting shen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this issue has been resolved!
it’s because the response buffer is not clear when we use the ServletOutputStream in Weblogic, so before we get the ServletOutputStream, just reset the response buffer. Then the problem is disappeared.

By adding following code:

response.resetBuffer();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic