File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes WebLogic Server - Problem encoding file MS Word in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Reply Bookmark "WebLogic Server - Problem encoding file MS Word in jsp" Watch "WebLogic Server - Problem encoding file MS Word in jsp" New topic
Author

WebLogic Server - Problem encoding file MS Word in jsp

mattia sarto
Greenhorn

Joined: Feb 01, 2008
Posts: 5
Hi, i'm new in this forum...sorry for my english but i don't speak it very well...

I have a problem with encoding of a MS Word file (with WebLogic Server 8.1.4).....I have this file stored in a DB Oracle like a BLOB...then I extract this file and I obtain the bytes of this file....than i write this byte in my ServletOutputStream so that i can see this word document from my jsp page in word format....until now everithing is ok...MS Word is open....but in the file the character are not encoded....are like this
"�� ��� � ���������� "....... why i can't see it correctly???
What I don't understand is thas:
1)in the same page with a pdf (even this extract as byte from oracle column BLOB) works fine
2)with the same web application deployed on a tomcat server everithings work fine (with doc,xls....)
3)I think that every settings is ok....
in the jsp file
response.setContentType("application/msword");
response.setHeader("Content-Disposition", "attachment; filename=test.doc");

in web.xml
<mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>

in weblogic.xml (I have read this in a forum)
<jsp-descriptor>
<jsp-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</jsp-param>
<jsp-param>
<param-name>compilerSupportsEncoding</param-name>
<param-value>false</param-value>
</jsp-param>
</jsp-descriptor>


The file that i obtain is not encode but is corret....infact if i make a compare (with a program "Beyond Compare" that meka a compare with the character not encoded like "�� ��� � ���������� ") between the file that I obtain and the original file....everithing is equal...so the file is ok....but i can't open this correctly and visualize it correctly in word format!

Please help me.....thanks so much
mattia sarto
Greenhorn

Joined: Feb 01, 2008
Posts: 5
I don't know it happens (certainly my error)....but sorry for my double post!!!
mattia sarto
Greenhorn

Joined: Feb 01, 2008
Posts: 5
I don't know it happens (certainly my error)....but sorry for my double post!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebLogic Server - Problem encoding file MS Word in jsp
 
Similar Threads
web.xml causes 404 error
Configuring Tomcat 5 on Win2K and Linux
Apache2 / Tomcat 6 / GWT 2.0 - Could use some help
WebLogic Server - Problem encoding file MS Word in jsp
warp conn prevents apache redirect