How to display GBK char in jsp

i use <%@page contentType="text/html;charset=GBK" %> to display GBK character. but some errors occur,"the GBK charset is not supported in this JDK".
but i can display GBK char using servlet.
please help me. thanks you

migrate yr JDK to 1.3 and use
<%@page contentType="text/html;charset=gb18030" %>

Similar Messages

  • 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 array values in jsp of screen flows

    Hi,
    can u please help me .
    I am having one array variable i have stored all the values but i have to display that in JSP page .how to display
    Edited by: user12171025 on Nov 4, 2009 11:11 PM

    Hi,
    I think that its necessaries to use AJaX.
    I am implemeting something like that.
    I have a input text that works like a filter and depends on what my user types in input text I populate my table with some information.
    In order to do that, I put in my JSP a div with an Id and I used ajax, like that:
    function ajaxFunction()
              var xmlhttp;
              if (window.XMLHttpRequest)
              xmlhttp=new XMLHttpRequest();
              else if (window.ActiveXObject)
              // code for IE6, IE5
              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              else
              alert("Your browser does not support XMLHTTP!");
              xmlhttp.onreadystatechange=function()
                                                      if( xmlhttp.readyState==4 )
                                                           document.getElementById("tabelaResponsaveis").innerHTML = xmlhttp.responseText;
         var resp = "<f:invokeUrl var='solicitacao' methodName='getResponsaveis'/>";
         xmlhttp.open("POST",resp,true);
         xmlhttp.send(null);
    getResponsaveis is a method inside my BPM that returns a HTML code (the table HTML code with all the information that I need to show.
    I Hope to help
    Thanks Marcos

  • How to display JCO.Table in jsp, CRM ISA

    Hi,
    I have got a JCO.Table with results from teh CRM system and now want to display this in ISA.
    Is there any templates, or code, that could guide me as to how to transfer the table to jsp.
    thanks,
    sunil

    Hi Sunil,
    The code from bean class is here,
    public void listDetails(String releaseGroup,String releaseCode)                                 
    throws Exception
                    try
                         if (mRepository == null )
                              System.out.println("NuLL");
                         try
    IFunctionTemplate                                         ft=mRepository.getFunctionTemplate("BAPI_REQUISITION_GETITEMSREL");
    myFunction=ft.getFunction();
                   catch (Exception ex)
                   throw new Exception(ex + "Problem retrieving JCO.Function object.");
          if (myFunction == null)
         System.exit(1);
    mConnection.execute(myFunction);
                   JCO.ParameterList input = myFunction.getImportParameterList();
                           input.setValue(releaseGroup,"REL_GROUP");
                           input.setValue(releaseCode,"REL_CODE");
                           input.setValue(releaseFlag,"ITEMS_FOR_RELEASE");
                             System.out.println("Imported");
                         catch (Exception ex)
                              ex.printStackTrace();
                              System.exit(1);
                          mConnection.execute(myFunction);
                JCO.Table codes = null;
               codes =myFunction.getTableParameterList().getTable("REQUISITION_ITEMS");
               size =codes.getNumRows();
               if (size == 0)
                  System.out.println("No value matches the selection cretaria");
               purchaseRequisitionNo = new String[size];
               item   = new String[size];
               requestorName = new String[size];
               description = new String[size];
               creatorName = new String[size];
               purchaseRequisitionDate = new String[size];
               plant = new String[size];
              // getter methods
         public int  getSize() { return size; }
         public String getPurchaseRequisitionNo(int i){return                                                        purchaseRequisitionNo<i>; }
          public String getItem(int i) { return item<i>; }
         public String getDescription(int i) { return description<i>; }
         public String getCreatorName(int i) { return creatorName<i>; }
         public String getPurchaseRequisitionDate(int i)
                                             {return purchaseRequisitionDate<i>; }
         public String  getplant(int i) { return plant<i>; }
    Now in the JSP page get the number of entries in the table and try to get row by row from the bean class using the row number.
    <%
    int count = PR.getSize() ; // This method will return the number of
    rows in the table.
    for ( int i = 0; i < count ; i++ ) {
    %>
    <TR><TD ALIGN = "center"><%= PR.getPurchaseRequisitionNo(i) %> </TD>
    <TD ALIGN = "center"><%= PR.getItem(i) %> </TD>
    <TD ALIGN = "center"><%= PR.getDescription(i) %></TD>
    <TD ALIGN = "center"><%= PR.getCreatorName(i)%> </TD>
    <TD ALIGN = "center"><%= PR.getPurchaseRequisitionDate(i)%> </TD>
    <TD ALIGN = "center"><%= PR.getplant(i)%> </TD>
    <% } %>
    Hope this is a simple way to get your requirement.
    Let me know if this does not help you.
    Thanks
    Kathirvel.

  • How to display uploaded image in jsp page.

    Hello,
    I am using struts 1.2.9 and and have uploaded image on the server. Now what I want to do display the image in jsp page after clicking on one link in jsp. I have tried many thing to display image in jsp page. But I am getting an error during displaying image in jsp. I have displayed absolute path in servlet. and used InputStream and outputstream to display image in jsp page.
    Can any one help.
    Thanks in advance
    Manveer Singh

    Follow this. This topic is very popular recently on the forum.

  • 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

  • How to display stored image in jsp  in ie7???

    i am using internet explore7. i have a problem when i am displaying an image in jsp its not properly coming. this image and image is stored in database.
    image is stored in database using "binarystream" .
    i am just simply calling the image path and using the html image display tag.
    <img src="<%=fileIpath%>" but image is not coming properly but this image is showing properly in lower ie version.
    Can anyone help me???

    can anyone reply this question??Appearently no.
    It might be that the question is not interesting enough to attract people.
    Or it might be that the details you provided do no suffice and some important pieces of information are missing. For eample: what are the contents of the variable? If you save the generated page, what do you get?

  • How to display HTML chars in report

    I have a field in database with following data.
    &lt;p&gt;This is data&lt;/p&gt;
    I have added a textbox in report in which I am displaying this column and it is displayed as it is. But I want to show it as HTML. So for that I created a function that decodes special chars and convert them into HTML.
    But after applying HTML decoding, now it is showing as:
    <p>This is data</p>
    As you can see now it is directly showing "<p>" tag instead of actually applying it. How do I fix this issue?

    That's strange, it should indeed not display the <p> tags.  Do any other supported tags work?  Try replacing p with b and check if the text is rendered in bold...
    List of supported tags: Importing HTML into a Report (Report Builder and SSRS)
    If that didn't help, have a look at the Properties pane with the placeholder selected.  The Properties
    dropdown will display "Selected Text", this way you can tell if you've got the placeholder selected (and not the whole textbox).  Now locate the MarkupType property.  It should be set to HTML.
    SQL Server MVP, MCITP/MCTS SQL Server 2008 <br/> Check out my articles at <a href="http://blog.hoegaerden.be">BI: Beer Intelligence?</a>

  • How to Display Seconds in a JSP file

    I want Display seconds in a SP page ,i need to alert the user that this page will be forwarded in 10 secs , so i need to display that on the page ..how can i make this happen ...can anyone throw some light on this issue ...
    Thanks
    Shyam

    Hello,
    Not sure to understand clearly what you want to do. So here some lights based on my understanding.
    So you want to see the page redirects to another location after 10sec, so in my opinion it has nothing specific to do with JSP but pure HTML development.
    1- Do the redirect
    Option 1
    On easy way is simply to put a meta-tag in the header of your page, something like
    <HEAD>
    <META HTTP-EQUIV="refresh" content="10;URL=http://blog.grallandco.com">
    </HEAD>
    Option 2
    You can also do it using Javascript:
    <script>
    function redirect()
    window.location="http://grallandco.com"
    function loadPage()
    var timer = window.setInterval("redirect()", 10000);
    </script>
    <body onLoad="loadPage();">
    2- Print the countdown
    Maybe you also want to print the countdown on the page. For this you have lot of solutions based on Javascript. I did a quick Google search on "javascript Countdowns redirect"
    Here one that looks good and easy to integrate to any page:
    Cool Redirect
    Regards
    Tugdual Grall

  • How to Display string array in jsp page using netui-data:repeater tag ??

    hi,
    I am trying to display a string array in a table using the netui-data:repeater tag.
    I have to use a page flow controller Array(1 Dimensional) to be displayed in the jsp.
    Can any one tell me how to print the array in a table of 3rows & 5 columns.
    Here is the code on which I am crrently working on.
    <netui-data:repeater dataSource="{pageFlow.strWorkObject_Array}">
    <netui-data:repeaterHeader>
    <table cellpadding="4" border="1" class="tablebody">
    </netui-data:repeaterHeader>
    <netui-data:repeaterItem>
    <tr>
    <td><netui:label value="{container.item}" >
    </netui:label></td>
    <td><netui:label value="{container.item}">
    </netui:label></td>
    <td><netui:label value="{container.item}">
    </netui:label></td>
    </tr>
    </netui-data:repeaterItem>
    <netui-data:repeaterFooter>
    </table>
    </netui-data:repeaterFooter>
    </netui-data:repeater>

    weblogic.developer.interest.workshop
    Mansoor Naseem wrote:
    I would like to know where the pageflow newsgroup is.
    These are all the groups in weblogic.developer.interest:
    weblogic.developer.interest.60beta.* (5 groups) weblogic.developer.interest.management
    weblogic.developer.interest.61beta.* (2 groups) weblogic.developer.interest.misc
    weblogic.developer.interest.clustering.* (1 group) weblogic.developer.interest.performance
    weblogic.developer.interest.commerce weblogic.developer.interest.personalization
    weblogic.developer.interest.ejb.* (3 groups) weblogic.developer.interest.portal
    weblogic.developer.interest.environment weblogic.developer.interest.rmi-iiop
    weblogic.developer.interest.jdbc weblogic.developer.interest.security
    weblogic.developer.interest.jms weblogic.developer.interest.servlet
    weblogic.developer.interest.jndi weblogic.developer.interest.tools
    weblogic.developer.interest.jsp weblogic.developer.interest.weblogicenterprise
    MN

  • How to display unicode character in jsp pages?

    i have to display user need language using unicode character according to user selected in radio button arabic or german in jsp
    pages. can you explain how i have to code?

    Hi,
    Visit the following URL http://java.sun.com/docs/books/tutorial/i18n/ .
    It will help you.
    bye for now
    sat

  • How to Display jFrame - chart in JSP PAge

    Hi all,
    Can any one help about this task..
    I have writeen a java file which generates multiaxis chart by using JFreeChart API....
    Say for ex..
    public class multiaxis extends JFrame
    /// till know no problem...
    Can any one tell its possible to display this chart (JFrame) in Browser (JSP Page) .. any idea over this..
    Thanks in advance

    there's examples around the forums about using JFreeChart in a servlet to generate a JPEG or PNG images.

  • URGENT:- how to display bullets in a  jsp field?

    Hi,
    I need to display the names prepended with a bullet. If am displaying two fields like group_id and Names in jsp, it should look like this.
    Note: arrows are given below only just for formatting or to display columns correctly in this posting
    Group_id---> Names
    1-----> . Joe
    ------> . mary
    ------> . John
    2-----> . Mike
    ------> . Susan
    3-----> . abc
    Please advise.
    -thanks

    Hi ,
    Is your data coming from a Collection or Vector or other sources? So , am sending a code in plain html for displaying content in the required format. You can replace the bolded characters in the code ,with your dynamic content using <%=YourVariable%> .
    <html>
    <body>
    <table border="0">
    <tr>
    <td valign="top">
    1
    </td>
    <td>
    <ul>
    <li type=disc> Name1<br>
    <li type=disc> Name2<br>
    <li type=disc> Name3<br>
    </ul>
    </td>
    </tr>
    <tr>
    <td valign="top">
    2
    </td>
    <td>
    <ul>
    <li type=disc> Name4<br>
    <li type=disc> Name5<br>
    <li type=disc> Name6<br>
    </ul>
    </td>
    </tr>
    </table>
    </body>
    </html>

  • How to display uploaded jpeg in jsp

    hi all,
    i am uploading image(jpeg) using FormFile in ..............
    then i am trying to display into the jsp but its display bytes only...........
    my code is as below
    jsp
    <html:form action="/viewImage.do" method="post"     enctype="multipart/form-data">
         <table cellpadding="0" cellspacing="0" border="0" summary="Image table">
              <tr>
                   <td align="right">Image </td>
                   <td align="left">
                        <html:file property="image" />
                   </td>
              </tr>
              <tr>
                   <td align="center" colspan="2">
                        <html:submit property="saveImage">Upload Image</html:submit>
                   </td>
              </tr>
    </table>
    </html:form>
    ------------------------my action is
    public void disImage(ActionMapping mapping,
                   ActionForm form, HttpServletRequest request,
                   HttpServletResponse response) throws Exception {
              CompanyImageForm companyImageForm = (CompanyImageForm)form;
              FormFile myFile = companyImageForm.getImage();
         String contentType = myFile.getContentType();
         String fileName = myFile.getFileName();
         int fileSize = myFile.getFileSize();
         byte[] fileData = myFile.getFileData();
    InputStream in = new ByteArrayInputStream(fileData);
         BufferedImage image=javax.imageio.ImageIO.read(in);
    response.setContentType(contentType);
    OutputStream sos = response.getOutputStream();
    ImageIO.write(image,"jpeg",sos);
    }

    Well here is an idea for you...
    1).Upload a File.Now this would be associated with an object like FileItem or FormFile whatsoever implementation we are using make sure the View Object we are using for this implementation is Serializable.
    2).Save the View Object (Form Bean) under the scope of session and forward/redirect it to a JSP.
    3).In the redirected/fprward JSP use <img> tag or equivalent framework tag and make sure you refer the src to a dedicated ImageServlet / Backing Bean(FormAction) Action or etc as per URL settings you are using.
    4).Use the logic which my fellow poster Balus has asked you to apply.
    Hope that might give you some idea.
    REGARDS,
    RaHuL

  • How to display local image using JSP in Struts

    I am trying to display image from my local disk (eg. file://C:/Documents%20and%20Settings/varshaaz/Desktop/DSC_6172.jpg). When I execute my JSP(http://localhost:8080/sharedgreeting/test.jsp) , Image doesn't display instead I see cross icon. Though properties of that icon shows correct file path.
    Content of my JSP is :
    <html>
    <body>
    <img src="file://C:/Documents%20and%20Settings/varshaaz/Desktop/DSC_6172.jpg"/>
    </body>
    </html>

    Store your images in a folder (I've called mine gfx) under the WebContent folder of the WAR and make a call to that folder using a relative link rather than one on your hard disk, if it is a web project.
    WebContent
    --- gfx
    --- stylesheets
    --- etc...
    --- createMeetingOrSomething.jsp
    Then the link in the above jsp will be:
    <img src="gfx/someJPEG.jpg" height="50">Illu
    Message was edited by:
    Illu

Maybe you are looking for

  • How to populate XML schema details in XSLT output

    I want to print details about XML schema , xmlns on XSLT output as below. <?xml version="1.0" encoding="UTF-8"?> <CBISEDACReqLogMsg xsi:schemaLocation="urn:CBI:xsd:CBISEDACReqLogMsg.00.01.04 CBISEDACReqLogMsg.00.01.04.xsd" xmlns="urn:CBI:xsd:CBISEDAC

  • How to copy master spread from one document to other

    I've used kNewMasterSpreadCmdBoss command and IMasterSpreadCmdData interface but it copies master spread with empty master page. Should I setup some additional parameters for command? Or should I use different mechanism?

  • Problem with Casting

    Dear all, I have two classes PureABox and ABoxDL. ABoxDL is an extension of PureABox . When I tried to call the clone() of ABoxDL, I get the following error message: OntologyManager.PureABox cannot be cast to OntologyManager.ABoxDL What's the problem

  • How to install Developer Tools via command line

    Hello, is there a way, to install the Developer Tool via Command line? I need only the unix tools. I have to install the unix tools over a ssh connection. Thanks in advance and best regards Martin

  • Dvd not reading burned dvds consistently

    I am having problems reading DVDs that I burn on my Mac Pro 5,1. I can burn a DVD, eject and then reinsert and it may not load. I can take it to another Mac and it will load without a problem. I've tried to do some research without much luck. Most po