Correct display of characters in the Browser - Pls Help - Urgent

Hi,
We have a java application running on solaris 8 connected to oracle 8.1.6 database. The database characterset has been changed to WE8ISO8859P15 to support Western European Characters and the Euro symbol.
The problem we are facing is, when the euro symbol (Alt + 0128) is entered thru the HTML form and then retrieved from the database and again displayed on the HTML form, it shows as inverted question mark or some other character.
If any one can tell us exactly the steps to follow overcome this problem, it would be of great help. What settings have to be changed in the webserver, database and the client side so that there is proper data conversion.
Immediate response is apprecited.
Thanks

Couple of samples to try:
1)
<%@ page contentType="text/html;charset=ISO-8859-15" %>
<HTML>
<HEAD>
<TITLE>Hello</TITLE></HEAD>
<BODY>
<%
String charset = response.getCharacterEncoding();
%>
<BR> encoding = <%= charset %> <BR>
<%
String nameValue = request.getParameter("euro");
String euroVal = "\u20ac";
if (nameValue == null || nameValue.length() == 0) { %>
<FORM METHOD="GET">
Please input your name: <INPUT TYPE="TEXT" NAME="euro" value="<%=euroVal%>" size=20> <BR>
<INPUT TYPE="SUBMIT">
</FORM>
<% }
else
nameValue= new String(nameValue.getBytes("ISO8859_1"), charset); %>
<H1> Hello, <%= nameValue %> </H1>
<%
//insert nameValue into database
%>
</BODY>
</HTML>
2)
<%@ page contentType="text/html;charset=ISO-8859-15" %>
<HTML>
<HEAD>
<TITLE>Hello</TITLE></HEAD>
<BODY>
<%
String charset = response.getCharacterEncoding();
request.setCharacterEncoding(charset);
%>
<BR> encoding = <%= charset %> <BR>
<%
String nameValue = request.getParameter("euro");
String euroVal = "\u20ac";
if (nameValue == null || nameValue.length() == 0) { %>
<FORM METHOD="GET">
Please input your name: <INPUT TYPE="TEXT" NAME="euro" value="<%=euroVal%>" size=20> <BR>
<INPUT TYPE="SUBMIT">
</FORM>
<% }
else
%>
<H1> Hello, <%= nameValue %> </H1>
<%
//insert nameValue into database
%>
</BODY>
</HTML>We have tired your code and here are the answers to your questions:
1. Does the euro example work in your environment?No it is not working.we could not run the second example because'
we don't have a "request.setCharacterEncoding(charset)" method.
we are using servlet 2.2 api
2. Is the HTML form a JSP/Servlet or a HTML calling CGI?we are having HTML/JSP form calling a servlet.
the results and forms are always JSP.
3. Try using a HTTP GET in the form and observe the URL on
the browser. Does it show the parameter as:
http://host:port/euro01.jsp?euro=%A4
Euro symbol's code point is A4 in ISO-8859-15. We'd like to make
sure it is not corrupted when it is sent to the server.your previous example shows it as %A4 but it is not inserting correctly
in the database.The ascii value of the inserted value is 191 but we guess the correct
ascii value is 164.
4. After insertion, check the value on the database server.
Assume you insert the data in the following table:
create table tab01 (col01 varchar2(100));
You can query the euro code point:
select dump(col01, 16) from tab01;
Check to see if the value shows A4.the result we have is Typ=1 Len=1: bf
5. Please be aware that the example above is for varchar/char
column. You mentioned uploading blob content into database. Is
it a separate issue? Or do you just request a blob example?Actually blobs are not a problem. What we actually meant is that we are uploading some blob content into the database for which we have to use com.oreilly.servlet.MultipartRequest. But inserting euro symbol becomes a problem when we use this. If we use without multipart request we are able to insert euro but will not be able to upload blob. Blob content is not related to euro.
6. If problem still persists, I suggest that you send us a simple
program of yours that include the HTML/JSP and your schema
(SQL). Here is the program we are using to test.
<html>
<HEAD>
<title>Charset Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15">
</head>
<body>
<form name='f' action="CharsetTestJSP.jsp" method=post enctype="multipart/form-data">
<input type=text name="TestValueMpr">
<input type=submit value="Submit for MultipartRequest">
</form>
<form name='forn' action="CharsetTestReqJSP.jsp" method=post >
<input type=text name="TestValueReq">
<input type=submit value="Submit for OrdinaryRequest">
</form>
</body>
</html>
this is the html file with two forms , one with multipart request and the other without it. When used the form without multipart request, inserting euro into the db, stores it correctly and displays it correctly when retrieved. The html form calls 2 jsp files which are as follows:
CharsetTestReqJSP.jsp
<%@ page contentType="text/html; charset=ISO-8859-15" %>
<%@ page import="com.interactive1.kf.Config,java.sql.*"%>
<%
          //response.setContentType("text/html");
//response.setHeader("Content-Type", "text/html; charset=ISO-8859-15");
//java.io.PrintWriter out = response.getWriter();
String test = "test";
String testFromForm = request.getParameter("TestValueReq");
* Here instaed of the test value we are
* inserting what is coming from the form
Connection con = null;
try {
con = Config.getInstance().getConnection();
StringBuffer sql = new StringBuffer("INSERT INTO x_temp VALUES (?)");
PreparedStatement pstmt = con.prepareStatement(sql.toString());
pstmt.setString(1,testFromForm);
pstmt.executeUpdate();
pstmt.close();
pstmt = con.prepareStatement("SELECT * FROM x_temp");
ResultSet rst = pstmt.executeQuery();
while(rst.next()) {
out.println(rst.getString("text"));
rst.close();
pstmt.close();
} catch (SQLException se) {
out.println("problem sql exception : " + se.getMessage());
} finally {
if (con!=null) {
try {
con.close();
} catch (SQLException se) {
se.printStackTrace();
out.println(response.getCharacterEncoding());
out.println("");
System.out.println("");
%>
CharsetTestJSP.jsp
<%@ page contentType="text/html; charset=ISO-8859-15" %>
<%@ page import="com.interactive1.kf.Config,java.sql.*,com.oreilly.servlet.MultipartRequest"%>
<%
System.out.println("request="+request.getParameter("TestValueMpr"));
MultipartRequest mpr = new MultipartRequest(request,5*1024*1024);
System.out.println("mpr="+mpr);
          //response.setContentType("text/html");
//response.setHeader("Content-Type", "text/html; charset=ISO-8859-15");
//java.io.PrintWriter out = response.getWriter();
String test = "test";
String testFromForm = mpr.getParameter("TestValueMpr");
* Here instaed of the test value we are
* inserting what is coming from the form
Connection con = null;
try {
con = Config.getInstance().getConnection();
StringBuffer sql = new StringBuffer("INSERT INTO x_temp VALUES (?)");
PreparedStatement pstmt = con.prepareStatement(sql.toString());
pstmt.setString(1,testFromForm);
pstmt.executeUpdate();
pstmt.close();
pstmt = con.prepareStatement("SELECT * FROM x_temp");
ResultSet rst = pstmt.executeQuery();
while(rst.next()) {
out.println(rst.getString("text"));
rst.close();
pstmt.close();
} catch (SQLException se) {
out.println("problem sql exception : " + se.getMessage());
} finally {
if (con!=null) {
try {
con.close();
} catch (SQLException se) {
se.printStackTrace();
out.println(response.getCharacterEncoding());
out.println("");
System.out.println("");
%>
I hope this will help you to suggest a remedy for our problem.
Thanks

Similar Messages

  • Problem in displaying Japanese characters on the browser.

    Hi Friends,
    Hope one of you could help me in this!!
    We are using SHIFT_JIS character encoding in our jsps to display Japanese characters.
    <%@ page contentType="text/html; charset=SHIFT_JIS" %>
    Is there any other configuration required on server side to let the Japanese characters being displayed? Because what I am getting on screen is quite annoying. Well something like below.
    ?V?M???????�
    Even though my knowledge in Japs isn't too good :-)) I can understand that these are not Japanese. I believe I am missing something in terms of server side configuration, Can anybody point that out. (Maybe some of the Japanese developers in here).
    This could not be a client side issue, since from the same machine I can access other Japanese sites and they display properly. Let me know if anybody can help.
    I am running these in WAS 5.0
    Thanks,
    King

    Your text in the JSP should be UTF-8 nevertheless - as would be ideal
    for internationalization. Java comes with a command-line conversion tool
    native2ascii which is bidirectional.
    As non-Japanese I am not certain whether "SJIS" might not be better (there
    are some name variations in java).
    The HTML generation will translate these characters to SHIFT_JIS in your case.
    Where the target encoding cannot handle the intended character it receives a
    question mark - hat you saw.
    Furthermore you need a proper font in HTML and under Windows (window title).
    Your webserver should have east-asian support. Though Japanese (and English)
    are standard, I, as non-japanese am not certain about SHIFT_JIS.
    Also there is some freedom in choice for a japanese encoding.

  • How can I filter the rows displayed on an ADF Table ? pls help urgent..

    Hi All,
    I have a page with ADF readonly table, based on who is logging in I want to filter the rows to be displayed when the page is firstly loaded. This page is called from the main menu.
    I have created a custom method in the Application Module Impl :
    public void setInvoiceFilter () {
    ViewObject vo = findViewObject("BrowseInvoice1");
    ViewCriteria vc = vo.createViewCriteria();
    ViewCriteriaRow vcr1 = vc.createViewCriteriaRow();
    vcr1.setAttribute("Userid","xxxx");
    vc.add(vcr1);
    vo.applyViewCriteria(vc);
    vo.executeQuery();
    The question is : where and how should I call this method ?
    is this a correct approach ?
    Thank you very much for your help,
    xtanto

    I assume you're talking about a JSF application.
    I think you should be able to do this in the constructor of a backing bean.
    1) Add an operation binding, bound to your service method, to the page's pageDefinition.
    2) On the JSF page flow Overview tab, add a managed property to the backing bean. Call it, say, myMethod, give it type oracle.bindings.OperationBinding, and give it the value #{bindings.nameOfYourOperationBinding}
    3) Add a myMethod field of type OperationBinding, with getter and setter, to your backing bean class.
    4) In the backing bean class's constructor, add code like:
    myMethod.execute();This will execute the method every time the page is loaded.
    Now, if you want to execute the method only the first time the page is loaded, it's a bit trickier. You need to set, and use, a session variable:
    Map sessionVars = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
    if (sessionVars.get("hereBefore") == null)
      myMethod.execute();
      sessionVars.put("hereBefore", "true");
    }

  • Hello! I am writing to inform you that about that you have a problem displaying your website in the browser.

    Hello! I am writing to inform you that about that you have a problem displaying your website in the browser.
    In Yandex browser. I decided to tell you, because the site is not displayed correctly. As in the screenshot.

    apart from the fact there's no way I could have answered your question confidently, I was also not able to supply my non-answer within your very tight time constraints.
    what happened? how'd you get on?

  • How to display "Image" object in the browser?

    can anyone please tell me how can i display "Image" object in the browser?
    I have an image object that i retrieved from AS400 BLOB object by using toolbox.jar (for as400 access for java including all necessary classes like jdbc driver, security etc.).
    i want to display this object in the browser so i will be able to web-enable my BLOB objects stored on as400.thx...

    In your HTML:
    <img src="ImageServlet">
    In ImageServlet:
    Make calls to DB to get your image as byte array and store it in:
    byte[] buffer = new byte[imageSize];
    ServletOutputStream out = response.getOutputStream();
    for(int i = 0; i < imageSize; i++)
    out.write(buffer, i, 1);
    out.close();

  • Hi there , I'm downloading game from Mac App store ( The Witcher 2) and it's stuck on waiting almost at the end of the download pls help?

    Hi there , I'm downloading game from Mac App store ( The Witcher 2) and it's stuck on waiting almost at the end of the download pls help? I don't want to download it again is there any solution for this?

    Please test after taking each of the following steps that you haven't already tried. Stop when the problem is resolved. Back up all data before making any changes.
    Step 1
    Rebuild the Spotlight index. If you try to search now from the magnifying-glass icon in the top right corner of the display, there will be an indication that indexing is in progress.
    Step 2
    Unlock the Network preference pane, if necessary, by clicking the lock icon in the lower left corner and entering your password. Cllck Advanced, open the DNS tab, and change the server addresses to the following:
    8.8.8.8
    8.8.4.4
    That's Google DNS. Click OK, then Apply.

  • My iphone 3g got stuck with the apple logo and loading bar since  last night when i try to reset the iphone pls help thanks!

    My iphone 3g got stuck with the apple logo and loading bar since  last night when i try to reset the iphone pls help thanks!

    Can you reset the phone by holding the on/off switch and home button down until your phone reboots and the Apple logo again displays?

  • After ios6 update, I have lost all control of audio via Bluetooth, plus my Bluetooth car radio is no longer displaying track information from the iPhone. Help!

    After ios6 update, I have lost all control of audio via Bluetooth, plus my Bluetooth car radio is no longer displaying track information from the iPhone. Help!

    Hi there,
    You're running an old version of Safari. Before troubleshooting, try updating it to the latest version: 6.0. You can do this by clicking the Apple logo in the top left, then clicking Software update.
    You can also update to the latest version of OS X, 10.8 Mountain Lion, from the Mac App Store for $19.99, which will automatically install Safari 6 as well, but this isn't essential, only reccomended.
    Thanks, let me know if the update helps,
    Nathan

  • My Ipad has stopped receiving emails today. It has IOS7 on it. The settings are correct but says "connection to the server failed" help!

    My Ipad has stopped receiving emails today. It has IOS7 on it. The settings are correct but says "connection to the server failed" help!
    It is the same accout that has been working find for years and just after I updated the software this has happened. My Mac is still receiving and sending via Outlook with the same account and settings. My Iphone 5C has also stopped and I tried deleting the account and adding again (via exchange as it's an exchange accout) the same way I always do and it won't even recognise it to add the settings.
    So annoying. Can anyone help?

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
     Cheers, Tom

  • Displaying a jpg on the browser using a simple http server.....

    Hi
    I've written a simple server which responds by sending a jpg file .
    BROWSER ---request---> SERVER ( reads a jpg file, converts to byte[] and writes to browser )
    ^
    |
    |
    <----response ----------
    So I connect from the browser and the server sends a jpg and I'd to display that. Everything is thru sockets. There is no webserver as such.
    The problem is, I'm getting the text fine, but instead of the picture, I get lots of characters...probably the browser is unable to interpret the jpg . How to I display the jpg ? Do I have to convert the characters in the server code before sending it ?
    Anything to do with Base64 encoding ??
    Thanks !!

    All answers to this question including mine disappeared ??????
    In order to serve an image or any other type of data over the HTTP protocol you have to supply the correct HTTP response header with the data.
    The stream of bytes written to the client should be structured like this:
    A status code followed by several lines of key/value pairs with header information, a blank line and finally the bytes of the image.
    All lines in the header should end with \r\n no matter what OS the server is running.
    HTTP/1.1 200 OK
    Date: Wed, 07 Nov 2001 18:37:47 GMT
    Server: MyServer/0.1
    Content-Type: image/jpeg
    Content-Length: 4321The Content-Length field must have the length of the image data in bytes. The Content-Type field must be the correct mime type for the image data.
    Read RFC 2068 if you want or need more information.

  • When accessing certain websites, I am met with a random string of characters in the browser window. What could be causing this?

    When trying to access certain websites, http://redditenhancementsuite.com/ or http://www.channel4.com/programmes/the- ... od#3293733 for example, all I get is a random string of characters in my browser window like the following:
    ‹­XmoÛ6þ>`ÿáª/Ý€ZÊËú²Í6Ð%ÍZ¬íŠ&A±O%щTI*®‡ýø='J¶”8^†._L‰wÇ{yîá)ÓG§¿Ÿ\üñᜟx÷vþí7ÓÂWeû+Eο•ô‚ ïë‰üÜš›YtbŽ—ÚO.ÖµŒ(O³ÈË/>aåŸ)+„uÒÏ¿˜ŒˆØˆWŸ”ó2Ï•§Wº:“ŒÐy£Œœ&a‚¥Ò×de9‹œ_—ÒRúˆ<ŽêNÈœ‹š°r1‹¬t1?Îÿ›Z$kœ7ÕÄp#¹úÜH»ž4jr¿ˆŸÅa7‡S.³ªöC/®Äo#r6›Eœ Ÿ’$3¹Œƒ¹83Uoù0~WJÇWpvšExý»É•ëÜqïŽÅ‡¹º5/Y–r"Ž(×^enìàÃÍUâ+ƒ‹ÆVwNOŠ€A8’š| aÅï€Åšhš«›v%0Ú‚"A†UµUQ•XJ—”fiâZ/#Z©Ü³èèé@$Õ²ðxx—¹YÄ‚\!qÛjmMÌØÞa<õzÂÛ#ûÇ°ÙÛçug²ìà„i"˜¶‘¶Q!B-BTÓ†‘ð‡¶˜"ìÍeµh¢hþÚTh"Ï!žC%7+]‘‡zua­YEóÓnsŸ…Ÿá~I8ë÷©@z²ºWùøêœÎðžOe›å_ !Qûds“5Ì Â+£;·N‡ïö)‹Zu*/?ŒÙ'˜¬Ôµÿ»ŸEŠ¥Ð×ÑüÞîS©i|¯GÂÓ€-ì4 …fL/­iêŸ.®(óf€xÿŸ+BØÀVq8ç¬þÄÇ€gŒí°OЄÀ¿Ò©¥–9žœÒKÇüíL œ rz鳊,ךPý%ÒRR.\‘aóâçMÊ|–Jò†rå èPòèK‘£îwxg¬€…*œŽp…LÍ¥Ü%xYçÂÃé÷òFZ\9‹‡Ëd‡ÙSÕ¥ôÎÛmÀ—šóƃ®ÜZˆ¶§ŽÝ]’yÁíuOçcwÜùÏÜvþ‹£™ ×ûR"NN4¿‰Cýz&xšK¿ uŒÜãVÚm|;<ÌÛ;ošÔœ="" ò1êgôt;®]ôÍ+ÐÖ1]:0ªŒ‘ÛpJç;G †ÑÆ«…‚%€‚広ÜȲ6T rawpgYàÜñ•9J†ˆ®‘›“vŒ€Ó-_ö›”5S˜©cw\%Ê~bÞE Ñ#@8BšrÔ8DGN°fLï'¡×S誇#gCÑ1+žU0óàòŒLÀG‰Ë‡Ó5Á‚äºMËöÌ'H*ŸŽ…š®‹ZT„)¹‘­ûˆ.P%£îRU*\Äp?dÚÏ^J‡ëù«Áˆ‚õ7ù0™ÝØvJ2€­—倕:)*Î.œUºODÈïškÙ˜rú±§+TS#òÜè Zñ1£Ûš”ß—br|‹F·”òókºB’j‘]£\mMR¢XŠì\ãðÿožËJ42“9ÞÍùþèoCÁí¢·ÁÁcÐX·ÃóæîK¶C$ý}ï8šGr·žål0 ŽäöL…#¹]£àHàAóßHãÎÐ7Úý—Io${ÏxÇùçaÎRÒç—ñ„P–VTøZ[RºÞŽÝ'ãjµŠ|x@UÖø€5Õ݉óÜcö¡s“JÜVbNßm*70Ý~x‚3l24͇Olã{º|ƒ;•ÂûüÊ…V²Ìōʙ¡ônßN[)zÉwS§ÊÁÌâãÕø¹u°ŠŠÉµÈoÒ}‚¿*þò—ÔTÄ
    The characters change depending on the website. I've tried disabling all extensions and plugins, reinstalling firefox and reinstalling java to no avail. The issue seems to be isolated to firefox, chrome is able to display the webpages without a problem. The problem occures following a malware in infection which would redirect goolgle searches in firefox. It was dealt with using Malwarebytes Anti-malware and by removing some entries from C:\WINDOWS\system32\drivers\etc\hosts file.

    Hi,
    I tried everything above but to no avail. Windows firewall seemed to be allowing Firefox through without it actually being in the exception list. However, I did remove Firefox but this time removing all profile data too. Reinstalling Firefox seemed to make the websites work. However I then restored my bookmarks, and suddenly the websites stopped functioning again, displaying the random string of characters. Could this be an issue with my bookmarks?

  • Template files display as code in the browser.

    I recently had to reinstall DW and delete my preferences from my machine.   I now have an odd issue.
    When working in a template file (.dwt) If I do a "preview in browser" (Firefox, IE, or Chrome) the browser shows me the template as a text file (code view) not rendering it.
    I have the newest browsers and DW CC 2014.2  - Windows 8.1
    Any ideas?   This worked before I removed and reinstalled DW (except in IE).  Now it does not work in any of the browsers.
    I have tried old sites and files... same for them all.
    Using html5 files.
    I know it is probably something simple... but I cannot seem to find it or and answer in the nets.
    Thanks for your help!

    Here is my basic css file.
    @charset "utf-8";
    /* ======================================================== */
    /*  GENERIC RESETS  */
    /* ======================================================== */
    body, div, a, img, span, iframe, audio, video,
    p, h1, h2, h3, h4, h5, h6, strong, small, ul, ol, li,
    pre, code, blockquote, sub, sup,
    table, th, td, tr, tbody, tfoot, thead,
    form, fieldset, legend, label, input, textarea,
    article, aside, canvas, details, figcaption, figure,
    footer, header, hgroup, menu, nav, section, summary  {
    margin: 0px;
    padding: 0px;
    border: 0px;
    img {
    border: none;
    max-width: 100%;
    -ms-interpolation-mode: bicubic;
    vertical-align: middle;
    nav ul {
        list-style:none;
    table {
    border-collapse: collapse;
    border-spacing: 0;
    /* HTML5 display-role reset for older browsers */
    article, aside, details, figcaption, figure,
    footer, header, hgroup, nav, section, summary {
    display: block;
    /* Corrects `inline-block` display not defined in older browsers */
    audio, canvas, video {
    display: inline-block;
    *display: inline;
    *zoom: 1;
    /* Corrects issue for `hidden` attribute not present in older browsers */
    [hidden] {
       display: none;
    body {
    /* Prevents iOS text size issues after orientation change */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    * Correct overflow not hidden in IE9
    svg:not(:root) {
    overflow: hidden;
    /* ======================================================== */
    /*   BASIC STYLES OF SITE - STANDARD STYLES FOR ALL SIZES */
    /* ======================================================== */
    body {
    font-family: Segoe, "Segoe UI", "DejaVu Sans", "Trebuchet MS", Verdana, sans-serif;
    font-size: 100%;
    line-height: 1.3;
    background-color: rgba(255,255,255,1.00);
    header {
    margin-left: auto;
    margin-right: auto;
    padding: 10px 2%;
    nav {
    padding-top: 5px;
    padding-bottom: 5px;
    margin-top: 10px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
    background-color: rgba(255,255,255,0.85);
    color: rgba(255,255,255,1.00);
    font-size: 1.125em;
    nav li {
    display: block;
    width: 100%;
    nav li a:link, nav li a:visited  {
    text-decoration: none;
    color: rgba(255,255,255,1.00);
    display: block;
    padding-top: 5px;
    padding-bottom: 5px;
    background-color: rgba(9,167,230,1.00);
    nav li a:hover {
    text-decoration: none;
    color: rgba(0,0,0,1.00);
    padding-top: 5px;
    padding-bottom: 5px;
    background-color: rgba(255,255,255,1.00);
    #mainContent {
    background-color: rgba(255,255,255,0.85);
    padding: 10px 2%;
    footer {
    background-color: rgba(34,99,183,0.65);
    margin-top: 10px;
    padding: 10px 2%;
    #copyright {
    padding: 20px 1%;
    font-size: 0.75em;
    text-align: center;
    /* ======================================================== */
    /*  TEXT AND LINK SETTINGS   */
    /* ======================================================== */
    h1 {
    font-size: 1.5em;
    color: rgba(9,167,230,1.00);
    h2 {
    font-size: 1.375em;
    color: rgba(43,43,43,1.00);
    h3 {
    font-size: 1.25em;
    color: rgba(9,167,230,1.00);
    h4 {
    font-size: 1.125em;
    color: rgba(238,22,150,1.00);
    h5 {
    font-size: 1em;
    color: rgba(252,176,52,1.00);
    h6 {
    font-size: 0.875em;
    color: rgba(115,158,1,1.00);
    #mainContent a:link, #mainContent a:visited {
    color: rgba(9,167,230,1.00);
    text-decoration: none;
    #mainContent a:hover {
    color: rgba(238,22,150,1.00);
    text-decoration: none;
    #copyright a:link, #copyright a:visited  {
    text-decoration: none;
    color: #09A7E6;
    #copyright a:hover {
    text-decoration: none;
    color: rgba(9,167,230,1.00);
    #mainContent ul li {
    margin-left: 30px;
    line-height: 1.3em;
    #mainContent ol li {
    margin-left: 30px;
    line-height: 1.3em;
    .clearfix {
    clear: both;
    margin-left: auto;
    margin-right: auto;

  • Excel Output is being displayed as HTML in the browser

    Hi All,
    I am using PeopleSoft XML Publisher 5.6.2 to generate an Excel report using RTF template. The report runs successfully.
    However, when I click the Output file link in the View Log page of process scheduler, the file is being displayed as a HTML page, though the extension of the file is .xls.
    Also when I try to save the file by using 'Save Taget as' option, the browser prompts me to save the file as 'mhtm' file and not 'xls' file.
    The following is an extract from the output file.
    <html>
    <!-- Generated by Oracle XML Publisher 5.6.2 -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>IM Top 10 Surplus &amp; Deficit Locations</title>
    After doing some research on Internet, I found the following blog post(dated back in 2008) to describe my situation and a workaround to the problem.
    http://peoplesofttipster.com/2008/04/16/xls-xmlp-output-opening-in-browser-not-excel/
    http://peoplesofttipster.com/2008/04/18/xls-xmlp-output-opens-in-browser-workaround/
    Workaround described in the above blog post is to update the charset to us-ascii replacing UTF-8. This seems to work. But with limited file processing capabilities of peoplecode, this workaround is not a simple solution.
    I also verified the mime-type mapping in the web.xml file in the webserver. Please find below the .xls mime-type mapping in the web.xml file.
    <mime-mapping> <extension> xls </extension> <mime-type> application/vnd.ms-excel</mime-type></mime-mapping>
    Question:
    1.How do I force the browser to open the excel output file using either Excel plugin or Excel Application instead of displaying it as HTML page?
    2.If not the above, how can I force the system to promt the user to save the file as Excel file instead of mhtml?
    Additional details :
    work enivronment
    PeopleSoft FSCM 8.9
    PeopleTools 8.48.17
    Oracle 10g
    Windows NT
    Any help would be greatly appreciated.
    Thanks & Regards,
    Vamsi Krishna

    Please try this by Open windows explorer, Click Tools -> Folder Options ->,Click on File Types and Select XLS from the list, Click Advanced, select "Open" and Make sure the “Browse in same window” is not selected.
    Hope this helps,
    Ramesh

  • Displaying XML content in the browser without creating the XML file

    Hi,
    In my web application, i am getting the data from the database and generating an XML file based on that. This file is created, read and its content is displayed in the browser when the user clicks a specific link on the jsp.
    As per the new requirement, i am not supposed to generate the XML file. Instead when the user clicks on the specific link on the jsp, the XML should get displayed in the browser directly without generating the XML file.
    Can someone plz help me in how to do this?
    Moreover, this XML generation application should support multiple clients. Do i need to make my application thread-safe explicitly even though i am using a servlet to do this?
    Please suggest
    Thanx

    Avoid multi post
    http://forum.java.sun.com/thread.jspa?messageID=9858529

  • Displaying xml content in the browser

    Hi,
    In my application i am generating an XML content which i was storing into a file. Now as per the new requirement, this xml content needs to be displayed in the browser. (The way it gets displayed when we double click on an xml file).
    Can some one plz tel me how to do this? I am using the jsp/servlet architechture..? plz help
    Thanx

    Program 1
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class SendXml extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        //get the 'file' parameter
        String fileName = (String) request.getParameter("file");
        if (fileName == null || fileName.equals(""))
          throw new ServletException(
              "Invalid or non-existent file parameter in SendXml servlet.");
        // add the .doc suffix if it doesn't already exist
        if (fileName.indexOf(".xml") == -1)
          fileName = fileName + ".xml";
        String xmlDir = getServletContext().getInitParameter("xml-dir");
        if (xmlDir == null || xmlDir.equals(""))
          throw new ServletException(
              "Invalid or non-existent xmlDir context-param.");
        ServletOutputStream stream = null;
        BufferedInputStream buf = null;
        try {
          stream = response.getOutputStream();
          File xml = new File(xmlDir + "/" + fileName);
          response.setContentType("text/xml");
          response.addHeader("Content-Disposition", "attachment; filename="
              + fileName);
          response.setContentLength((int) xml.length());
          FileInputStream input = new FileInputStream(xml);
          buf = new BufferedInputStream(input);
          int readBytes = 0;
          while ((readBytes = buf.read()) != -1)
            stream.write(readBytes);
        } catch (IOException ioe) {
          throw new ServletException(ioe.getMessage());
        } finally {
          if (stream != null)
            stream.close();
          if (buf != null)
            buf.close();
      public void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        doGet(request, response);
    Program 2
    import java.io.BufferedInputStream;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLConnection;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ResourceServlet extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        //get web.xml for display by a servlet
        String file = "/WEB-INF/web.xml";
        URL url = null;
        URLConnection urlConn = null;
        PrintWriter out = null;
        BufferedInputStream buf = null;
        try {
          out = response.getWriter();
          url = getServletContext().getResource(file);
          //set response header
          response.setContentType("text/xml");
          urlConn = url.openConnection();
          //establish connection with URL presenting web.xml
          urlConn.connect();
          buf = new BufferedInputStream(urlConn.getInputStream());
          int readBytes = 0;
          while ((readBytes = buf.read()) != -1)
            out.write(readBytes);
        } catch (MalformedURLException mue) {
          throw new ServletException(mue.getMessage());
        } catch (IOException ioe) {
          throw new ServletException(ioe.getMessage());
        } finally {
          if (out != null)
            out.close();
          if (buf != null)
            buf.close();
      public void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        doGet(request, response);
    }Have fun

Maybe you are looking for