How to display Arabic content in JSP ?

Hi all,
I used the following encoding method to display arabic content in JSP page.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
I also set -Dfile encoding=ISO-8859-6 in the JVM Options.As a result the arabic data is getting displayed .
Variable "data" contains the actual arabic data.
function updateArabicData(data){
try{
document.getElementById('divtag').innerHTML=""+data;
}catch(err){
<html>
<body>
<div id="divtag" lang="ar-sa"></div>
</body>
</html>
But the problem is the arabic data getting displayed in JSP (within the <div>)seems to be jumbled up.The users say that the arabic words within a single sentence are not arranged correctly.They are mixed up.Please help me with a solution.
Edited by: Alance on May 27, 2010 5:34 AM

Data is retrieved as follows
if(msg.getField("GEN_UNICODE_MESSAGE_1")!=null){
resultString=resultString+"N"+""+new String((byte[])msg.getField("GEN_UNICODE_MESSAGE_1").value.get(0),"ISO-8859-6");
with content Type set as response.setContentType("text/html;charset=ISO-8859-6");
ISO-8859-6 -since the data contains arabic news.
Edited by: Alance on May 27, 2010 11:05 PM

Similar Messages

  • Display request contents in JSP page

    i need to display the contents in a request in my JSP.
    meaning:
    i have a hashmap (containing string and a list) coming from the EJB tier to struts action in an event response object, I'm sure that the request has these values. cuz i tested it in struts action using the following code:
    HashMap result = (HashMap)((EventResponseSupport)request.getAttribute(WebKeys.EVENT_RESPONSE)).getPayload();
    System.out.println("Sponsor name = " + result.get("sponsor"));I am able to print it in the console but i need to know how to display it in the jsp. i tried many things but i can't get it right.
    first i need to display the string and then i need to iterate through the list to display its contents in a table.
    any help would be appreciated.

    Kindly use JSP Scriplet to load the HashMap into the Page Context.
    Then you can use the Struts iterate tags to paint the contents of the HashMap

  • How to display the contents of the database values which are retrived.

    how to display the contents of the database values which are retrived in servlets and i am able to display the contents in the servlets and if forward to jsp using requestdespatcher,the values are to be shown in jsp one below the other.please suggest me in these........the servlet code is as shown
    while(rs.next()){
                        buffer.append(rs.getString(1));
                        buffer.append(rs.getString(2));
                        buffer.append(rs.getString(3));
                        buffer.append(rs.getString(4));
                        buffer.append(rs.getString(5));
                        buffer.append(rs.getString(6));
                        buffer.append(rs.getString(7));
                        buffer.append(rs.getString(8));
                        buffer.append(rs.getString(9));
                        buffer.append(rs.getString(10));
                        request.setAttribute("result1",buffer);
                        RequestDispatcher rq=request.getRequestDispatcher("/results.jsp");
                        rq.forward(request,response);
    in jsp iam using the getAttribute to retrieve the values as shown
    <% StringBuffer sb=(StringBuffer)request.getAttribute("result1"); %>
    <%= sb %>
    but getting the results in the stretch,i need to display the result one below the other.

    if you load it all into the buffer that is going to be very difficult. I would suggest loading it into some sort of collection. I like using an ArrayList.
    Then pass the arraylist.
    you will then on the jsp iterate through the arrayList using what every you want.. el, logic tags, scriplets.
    so something like
    ArrayList arrayList = new ArrayList();
    while(rs.next()){
    arrayList.append(rs.getString(1));
    //or possibly an arrayList of String arrays
    //maybe using nested for loops.  Inner for loop adds result to string[] then //outer adds string[] to arrayList.
    //can be done any number of ways based on your expected result set.

  • How to display the content of a region on a different page

    Hello,
    Does anyone knows how to display the content of a region on an other page. I try to make page that displays content that resides somewhere else in my portal, so I can give a summarization of some hot topics. I really want to display the whole content of some regions (not a display with custom search).
    Thanks a lot,
    Hans

    Set that page as portlet, include it in a region in another page and in the edit defaults decide which regions you want to display.
    Mere.

  • How to display the content of a BLOB column in a ADF/BC pages ?

    How to display the content of a BLOB column in a ADF/BC pages ?
    There is some image in database table blog column. And we want to display image on the screeen.
    There is some example about upload and dowload blog columns.
    (steve not yet document example page etc...)
    But We want to display blog picture in a image component...
    is there any basic way to do it ?
    Thanks a lot...

    Ali,
    You could just download the sample app... but... here is the servlet code from the demo (look at it just for technique - you'll obviously have to change it for your needs)...
    John
    package oracle.fodemo.storefront.servlet;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.ViewObject;
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.BlobDomain;
    import oracle.jbo.domain.DBSequence;
    import oracle.jbo.domain.Number;
    import oracle.jbo.server.ViewObjectImpl;
    public class ImageServlet
      extends HttpServlet
      private static final String CONTENT_TYPE =
        "image/jpg; charset=windows-1252";
      public void init(ServletConfig config)
        throws ServletException
        super.init(config);
      public void doGet(HttpServletRequest request,
                        HttpServletResponse response)
        throws ServletException, IOException
        response.setContentType(CONTENT_TYPE);
        response.setContentType(CONTENT_TYPE);
        String detailProductId = request.getParameter("detail");
        String thumbnailProductId = request.getParameter("thumbnail");
        boolean thumbnail = true;
        String productId = null;
        OutputStream os = response.getOutputStream();
        String amDef = "oracle.fodemo.storefront.store.service.StoreServiceAM";
        String config = "StoreServiceAMLocal";
        ApplicationModule am =
          Configuration.createRootApplicationModule(amDef, config);
        ViewObjectImpl vo =
          (ViewObjectImpl) am.findViewObject("ProductImages"); // get view object (the same as used in the table)
        if (detailProductId != null)
          productId = detailProductId;
          thumbnail = false;
        else
          productId = thumbnailProductId;
        vo.defineNamedWhereClauseParam("paramThumbnail", null, null);
        vo.defineNamedWhereClauseParam("paramProductId", null, null);
        vo.setWhereClause("DEFAULT_VIEW_FLAG = :paramThumbnail AND PRODUCT_ID = :paramProductId");
        vo.setNamedWhereClauseParam("paramThumbnail", (thumbnail? "Y": "N"));
        vo.setNamedWhereClauseParam("paramProductId", productId);
        vo.executeQuery();
        Row product = vo.first();
        BlobDomain image = (BlobDomain) product.getAttribute("Image");
        InputStream is = image.getInputStream();
        // copy blob to output
        byte[] buffer = new byte[10 * 1024];
        int nread;
        while ((nread = is.read(buffer)) != -1)
          os.write(buffer, 0, nread);
        os.close();
        vo.setWhereClause(null);
        vo.removeNamedWhereClauseParam("paramProductId");
        vo.removeNamedWhereClauseParam("paramThumbnail");
        Configuration.releaseRootApplicationModule(am, false);
    }

  • How to display arabic Subtitle Language?

    How to display arabic Subtitle Language?
    i buy move with arabic subtitle.
    when i go to
    Settings > Audio & Video > Subtitle Language
    NO arabic option!!!!

    I don't think the apple tv has ever supported Arabic.  Tell Apple you want it via
    http://www.apple.com/feedback

  • How to display link content on the the same sharepoint page on click event

    "How to display link content on the the same sharepoint page on click event"
    Detail:
    we are using a document library where all html files are stored/uploaded.  we would like to display/open the html file on the same sharepoint page where all the files are listed.
    Thanks.

    Use jQuery and set the target to self to the anchor tag
    Regards,
    Sairam Avacorp Technologies

  • How to display XML content in a JSP

    Hi,
    can anyone help me in displaying xml content in a JSP?

    I think you want to display value from XML page to the
    JSP.If thats the case you can try out this
    xml...
    <component-profile>
            <property name="parm" value="Hi"/>
    </component-profile>
    jsp...
    <% var=profile.getProperty("parm");%>
    Hope this helps
    gEorgE

  • How to display text file in JSP?

    Hi,
    I am new to servlet/JSP/java programming.
    I have been able to download a file using ftp. I dont know who to display it in JSP.
    Here is my code. Any help will be appreciated...
    <%@ page import="java.util.*" %>
    <%@ page import="java.lang.*" %>
    <%@ page import="java.net.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="com.dmhistory.*" %>
    <html>
    <head>
    <title>Untitled</title>
    </head>
    <body>
    <%
    byte[] bytes = new byte[4096];
    URL theUrl = new URL("ftp://user:passwd@host/migr/Movers_for_Ora8/BG/logs/FLD-PAC3-20020311.log");
    BufferedInputStream in = new BufferedInputStream(theUrl.openStream());
    BufferedOutputStream outstream = new BufferedOutputStream(new FileOutputStream( new File( "D:/temp/log.txt" )));
    int pos = in.read( bytes );
    while ( pos != -1) {
    outstream.write( bytes, 0, pos );
    pos = in.read( bytes );
    %>
    <%
    in.close();
    %>
    DONE!!!
    </body>
    </html>
    How can i display this downloaded file in the browser?
    I want to display it in the original format i.e which new line and carriage returns...line by line..
    Thanks,

    Hi,
    I finally go it to display. but now I have new problem. The browser shows the text without the /n/r.
    But when I view the source using 'view->source', if see that the text has got proper format with newline and carriage returns.
    Any ideas how to display it correctly in the browser?
    <%
                   URL theUrl = new URL("ftp://user:pwd@host/migr/Movers_for_Ora8/BG/logs/FLD-PAC3-20020311.log");
                   //URL theUrl = new URL("ftp://dbcmaint:[email protected]/migr/Movers_for_Ora8/SNP/logs/SNP-PAC2-20020314.log");
                   URLConnection uc = theUrl.openConnection();
                   InputStream content = uc.getInputStream();
                   BufferedInputStream in = new BufferedInputStream (content);
                   LineNumberReader lnr = new LineNumberReader (new InputStreamReader (in));
                   String tempStr = "";
                   String str = "";
                   while ((tempStr = lnr.readLine()) != null) {
                   str += (tempStr);
                        %>
                        <%=tempStr%>
                        <%tempStr = "";
                        %>
                   <%
                   in.close();
                   lnr.close();
              %>
    Thanks

  • How to display Flash Content uploaded in Admin Console

    HI All ,
    I have created a flash content in the admin console.Flash file is uploaded to a binary property.
    I have to display that flash file in the JSP.
    Normally , a Image can be displayed in the JSP , with following tag,
    *<img src="<%=request.getContextPath() + "/ShowProperty" + node.getPath()+"//Brochure-Image"%>" />*
    But how to display a flash content uploaded in the admin console.
    Pls suggest me in this regard,
    Srinivas

    There is no wlp tag to display flash image. You have to use HTML object tag for this. Just google it and you will find lot of answer how to include flash file in your JSP.
    Either you pass a path to your repository or save the file somewhere on you local drive and use that path.
    <object width="968" height="209" id="mymoviename">
                        <param name="movie" value="../flash/abcd.swf"/>
                        <param name="quality" value="high"/>
                        <embed src="../flash/abcd.swf" quality="high"
                        pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
                        type="application/x-shockwave-flash" width="774" height="204"></embed>
    </object>

  • BB Bold 9000 How to display Arabic SMS text

    I'm new to these forums so sorry if I'm posting this in the wrong spot .. please redirect me if so.
    Recently bought BB bold 9000 from Vodafone Aust. Need to know how to display msgs or emails received in ARABIC text .. any help would be appreciated.
    Solved!
    Go to Solution.

    Hi,
    Download the OS for the carrier and use Application loader inside the Desktop manager software (that came with the Box)  and select Arabic with the language options (if that is an option).
    Alternatively you could install the OS from an Arabic carrier (involves deleting the vendor.xml file), but its not recommended....
    This is the instructions from my website (the short version):
     Get an OS from here:http://na.blackberry.com/eng/support/downloads/download_sites.jsp
    The Operating system software downloaded from the Blackberry website contains all the files required to reload the O/S.
    The Desktop Manager software is NOT required!
    Once downloaded and installed, follow these directions:
    Download the OS file from your carrier website to the PC then install it to the PC by running (double clicking) the file you downloaded.
    Go to c:\program files\common files\research in motion\apploader and delete the file named "vendor.xml."
    Plug in BB and double click on "Loader.exe." It's located in the same place as the above vendor.xml file.
    The process takes about 45 minutes to an hour depending on how much data you have to backup and restore during the process. Once it's done loading the new OS it will reboot (it may do this twice during the entire process.) You will see a white screen with an hourglass for up to 20 minutes at a time while the DM says "waiting for initialization." If, for some reason, you end up with a white screen with small icons and the number 507, simply connect to the PC again and run Loader.exe again and it should load the OS to the device.
    Checked out my Blackberry FAQ's and Links to Needed Articles here
    http://darkeen.homelinux.com/index.php/Blackberryfaq

  • Need help for how to putting arabic content in java properties file

    Hi all,
    we have to support arabic in Java application.
    For that we are using java propeties file where key and value pair is used.
    In the Microsoft excel sheet arabic content is coming properly from right to left direction.
    When same thing is copied and paste in java properties file contents direction is reversed that is it is coming from left to right as in english.
    Please help how to put the arabic contents in propeties file
    Regards
    Vidya

    So in terms discussion.
    First I would suggest that you get a hex editor and validate exactly what is in the properties file. It appears to me that you are using one or more editors that are adjusting the display for you and thus that makes it hard to determine where the problem is. A hex editor should not adjust the display. Although even then you might want to right a simple java app and have it read bytes and print them just to validate that the hex editor isn't doing something.
    Only after you are exactly sure how the bytes appear in the file then proceed with other steps.
    For the java GUI only test the following.
    1. Properties file has it left to right then the java GUI displays it correctly right to left or not?
    2. Properties file has it right to left then the java GUI displays it correctly right to left or not?
    Myself I would expect that 2 should be the correct way to implement this. However that is dependent upon you correctly invoking the api as well. So if 2 is not working then you might want to look at the api. It might also have something to do with GUI display properties (of which I know even less.)

  • How to display the contents of java.util.list in a frame???

    i should use awt only not applet...
    i need to display the contents of java.util.list in a frame...
    the contents contains rows queried from a oracle database.....
    the contents should be displayed similar to how a lable is displayed..
    please help me out..
    thanks
    dinesh

    Of course there is something in AWT:
    http://java.sun.com/j2se/1.5.0/docs/api/java/awt/List.
    htmlagain, if you carefully read the question, he needs a
    table to display a JDBC result set. There is no
    pre-made table component in AWT.Well, I read that he filled the data into a java.util.List and now wants to display this list. So a List-component should be sufficient. But I might be wrong...
    -Puce

  • How to display the contents of an array list to a listview?

    Hi. How do I display the contents of an arraylist to a listview?
    Here is my current code:
    var c: Control= new Control();
    var simpleList: ArrayList = c.ListResult; //ListResult is an ArrayList containing strings
    var simpleListView : ListView = ListView {
            translateX: 0
            translateY: 0
            layoutX: 20
            layoutY: 80
            height: 130
            width: 200
            items: bind simpleList;
    Stage {
        title: "Trial app"
        width: 240
        height: 320
        style: StageStyle.TRANSPARENT
        scene: Scene {
            content: [ simpleListView
    } [http://img341.imageshack.us/img341/133/listview.jpg]
    My code generates the result in this screenshot above. It shows that all the contents on the arraylist is displayed in one row/item.
    It should be displayed as (see bottom image) ...
    [http://img707.imageshack.us/img707/3745/listview1.jpg]
    Do you guys have any idea on this? Thank you very much for your replies

    For your listbox data to bind the listbox requires a Sequence. This is something that you can sort out at the entrypoint of your code.
    In the example below I have used an ArrayList to simmulate the data you have entering your FX code, but then I put that list into a Sequence, in your case instead of having an ArrayList in your FX code, you simple supply the list on entry, as I have marked in the following code.
    * Main.fx
    * Created on 12-Feb-2010, 10:24:46
    package uselists;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.text.Text;
    import javafx.scene.text.Font;
    import java.util.ArrayList;
    import javafx.scene.control.ListView;
    import javafx.animation.Timeline;
    import javafx.animation.KeyFrame;
    * @author robert
    //Simmulate your data with an ArrayList
    var simpleList: ArrayList = new ArrayList;
    simpleList.add("Hello");
    simpleList.add("World");
    // *** This is what your entry point would become, just load the simpleList.toArray() into your sequence ***
    var simpleSequence = [];
    simpleSequence = simpleList.toArray();
    //after some time add some items, to show that our binding is working
    Timeline {
        repeatCount: 1
        keyFrames: [
            KeyFrame {
                time: 5s
                canSkip: true
                action: function () {
                    //you can work on the Sequence to add or remove
                    insert "Another item" into simpleSequence;
                    //if you at some point want to have your array reflect the changes
                    //then perform your changes on that too
                    simpleList.add("Another item");
                    //remember depending on your app
                    //you may keep the update of simpleList
                    //until you are finished with this view and do it in a single update
            KeyFrame {
                time: 10s
                action: function () {
                    //Alternatly, to keep your ArrayList correct at all times
                    //add items to it and then update your Sequence
                    simpleList.add("Added to array");
                    simpleSequence = simpleList.toArray();
    }.play();
    Stage {
        title: "Application title"
        scene: Scene {
            width: 250
            height: 80
            content: [
                ListView {
                    items: bind simpleSequence
    }You can bind to a function rather than the data, which I am sure would be needed some cases, for example if the listBox data was a named part of a hash value for example, all that is required is that your function returns a sequence.

  • How to display the content of a file in the portal?

    Hey guys, could anyone help?
    I just created a page which includes two iView, one is KM Navigation iView to display a certain repository, while the other is for displaying the content of a certain file I click in the navigation iView.
    And now the problem is when I click a file in the KM Navigation iView, it will pop up a new window to display it. How can I make it displayed in a fixed iView, which type of this iView should be?

    Hi,
    you can try to use the:
    <b>ConsumerTreeListPreview</b>
    layout for KM navigation ivew (or customize to your own).
    This layout shows a folder tree on the left, a document list on the right. When you click on a document from the list it shows the contents of the file on the bottom of the iview.
    Hope this helps,
    Romano

Maybe you are looking for

  • Problem with Mac Mini and Panasonic PT-AE700 projector

    I just bought a brand new Mac Mini and intended to connect it through hdmi to my Panasonic PT-AE700 projector (with a 10 m hdmi-hdmi cable and a dvi-hdmi adapter). However there is no signal recognized by the projector. Any suggestions? I have tried

  • How to impert standard text?

    hi, can anybody tell me how to import standard text?

  • Safari can't display the security code

    I was trying to charge my international calls account online but I noticed that Safari was unable to show the security code in the web site: https://www.smslisto.es/en/login I couldn't get it to show up until I used a PC with Internet explorer. I tri

  • How do you edit samples in esx 24?

    Hello, I am trying to edit my saples in ESX 24 by clicking on the triangle next to the audio files name and choosing "open in sample editor." I edit the audio file, close sample editor wanted thew sample to reflect the edit but it does not. Thank you

  • Tried restoring, now not working

    Hello. To start off, yesterday my iPod was working perfectly fine. Last night I tried restoring it and now won't even turn on. When I try to plug it in it says "Usb device not recognized." If anyone could help with this I would greatly appreciate it.