Unicode in page contentType?

<%@page contentType="text/html;charset= .... "%>
Is it possible to set charset to unicode in page contentType?
Which identifier?
Thank you.
Ondrej Psencik

Ondrej,
Without going into details, I would recommend using charset=UTF-8
If you have problems with this, please post back with info: what characters you
are using (Korean, Chinese), are you using the i18n tags, etc.
Cheers,
PJL
"Ondrej Psencik" <[email protected]> wrote:
>
<%@page contentType="text/html;charset= .... "%>
Is it possible to set charset to unicode in page contentType?
Which identifier?
Thank you.
Ondrej Psencik

Similar Messages

  • Dynamic page contentType

    Good afternoon...
    I'm developing an application using Struts and I need to be able to change either the JSP being used depending on the content-type (either HTML or XML) that I have to generate
    -or-
    use the same JSP but change the contentType of the JSP and execute only the part of the JSP that pertains to that type.
    Thanks,
    Eric Schultz.

    Oh, how.... well, hmmmm. You might need to be more specific then that, because I don't really know what level you are at, on a technical level, or where you are at with what you have already written. I mean, do you know how to create a JSP file to write out the HTML and just aren't sure how to use XML instead? Or you know how to make either or... in that case...
    Well, I guess that all depends. You could have separate JSP files and Struts can forward from the actions to the specific JSP page. Of course, the how here depends partly on how you need to decide whether to use HTML or XML.
    Or you could write one JSP page, and write out the relevant code...:
    <% if(useXml) { %>
    <?xml version="1.0"?>
    <% } else { %>
    <html>
    <% } %>

  • Problem with transfering unicode form data in MULTIPART/FORM-DATA

    HI experts,
    I have this web based multilingual application. Page 1(form6.jsp) is basic registeration form with 5 fields and one image upload to the server. Page 2(verify.jsp) is another jsp page for verification of UTF data entered in page 1.
    page 2 (verify.jsp) also uses a bean called (verify.java) for picking up values. page 3(insertEntry.jsp) is the page for inserting that data into the Database and uses a bean called (logicbean.java).
    Now, the problem im facing here is that if i use multipart/form-data, the unicode text filled in page1 is shown as garbage when its is transfered to page2 and displayed on page2. It is all gibberish. But if i do not use multipart/form-data, the unicode text transfered from page1 to page2 is displayed perfectly on page2.Im using devenagari(UTF) language for filling in details.
    // form6.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <%@ page import="java.util.*,java.text.*" %>
    <%@ page import="com.oreilly.servlet.*" %>
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <HTML>
    <HEAD>
    <TITLE>
    <%=session.getValue("main.title")%>
    </TITLE>
    </HEAD>
    <h1><center><%=session.getValue("main.head")%><Center>
    <BODY background="brown.bmp">
    <form name=form6 action="verify.jsp" method="post" enctype="multipart/form-data">
    <center>
    <font>
    <table border=1>
    <tr>
    <td colspan=2><center><img src="asok.bmp"></center>
    </tr>
    <tr>
    <td >
    <b>1.)<%=session.getValue("main.ec")%></b>
    </td>
    <td></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.ecname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="votername"></td>
    <td></td>
    </tr>
    <tr>
    <td align="right"> <b><%=session.getValue("main.ecsurname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="votersurname"></td>
    <td></td>
    </tr>
    <tr>
    <td align="left"><b>2.)<%=session.getValue("main.rel")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    <select name="relation" onchange="if(this.selectedIndex!=0){this.form.texthiddenrelation.value=this.options[this.selectedIndex].value}" size="1">
                                       <option>Choose</option>
    <option value="father">Father</option>
    <option value="mother">Mother</option>
    <option value="husband">Husband</option>
    </select>
    <input type="hidden" name="texthiddenrelation" />
    </td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.relname")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="parentname">
    <td></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.relsurname")%>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</b><input type="text" name="parentsurname">
    <td></td>
    </tr>
    <tr>
    <td align="right"><b>3.)<%=session.getValue("main.sex")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
    <select name="sex" onchange="if(this.selectedIndex!=0){this.form.texthiddensex.value=this.options[this.selectedIndex].value}" size="1">
                                            <option>Choose</option>
                                            <option value="male">Male</option>
    <option value="female">Female</option>
    <option value="other">Other</option>
    </select>
    <input type="hidden" name="texthiddensex" /> </td>
    <td align="right"><b><%=session.getValue("form6.image")%><input type ="file" name=pic1 onchange={this.form.pic.value=this.form.pic1.value}><input type= hidden name=pic> </b></td>
    </tr>
    <tr>
    <td colspan=2><b>4.)<%=session.getValue("main.age")%></b><input type="text" name="age">
    </td>
    </tr>
    <tr>
    <td><b>5.)<%=session.getValue("main.dob")%></b>
    <td><b><%=session.getValue("main.dobday")%></b> <select name="cmbday">
    <option value="1"> 1 </option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    <option value="6">6</option>
    <option value="7">7</option>
    <option value="8">8</option>
    <option value="9">10</option>
    <option value="10">11</option>
    <option value="11">12</option>
    <option value="12">13</option>
    <option value="13">14</option>
    <option value="14">15</option>
    <option value="15">16</option>
    <option value="16">17</option>
    <option value="17">18</option>
    <option value="18">19</option>
    <option value="19">20</option>
    <option value="20">21</option>
    <option value="21">22</option>
    <option value="22">23</option>
    <option value="23">24</option>
    <option value="24">25</option>
    <option value="25">26</option>
    <option value="26">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
    <b><%=session.getValue("main.dobmonth")%></b><select name="cmbmonth">
    <option value="jan">JAN</option>
    <option value="feb">FEB</option>
    <option value="mar">MAR</option>
    <option value="apr">APR</option>
    <option value="may">MAY</option>
    <option value="jun">JUN</option>
    <option value="jul">JUL</option>
    <option value="aug">AUG</option>
    <option value="sep">SEPT</option>
    <option value="oct">OCT</option>
    <option value="nov">NOV</option>
    <option value="dec">DEC</option>
    </select>
    <b><%=session.getValue("main.dobyear")%></b> <select name="cmbyear" onchange="if(this.form.cmbday.selectedIndex!=0 && this.form.cmbmonth.selectedIndex!=0 && this.form.cmbyear.selectedIndex!=0){this.form.mergedage.value=this.form.cmbday.options[this.form.cmbday.selectedIndex].value +' '+this.form.cmbmonth.options[this.form.cmbmonth.selectedIndex].text +' '+ this.form.cmbyear.options[this.form.cmbmonth.selectedIndex].value}" size="1">
    <option value="1970">1970</option>
    <option value="1971">1971</option>
    <option value="1972">1972</option>
    <option value="1973">1973</option>
    <option value="1974">1974</option>
    <option value="1975">1975</option>
    <option value="1976">1976</option>
    <option value="1977">1977</option>
    <option value="1978">1978</option>
    <option value="1979">1979</option>
    <option value="1980">1980</option>
    <option value="1981">1981</option>
    <option value="1982">1982</option>
    <option value="1983">1983</option>
    <option value="1984">1984</option>
    <option value="1985">1985</option>
    <option value="1986">1986</option>
    <option value="1987">1987</option>
    <option value="1988">1988</option>
    <option value="1989">1989</option>
    <option value="1990">1990</option>
    <option>
    </select>
    <input type="hidden" name="mergedage">
    </tr>
    <tr>
    <td colspan=2><b>6.)<%=session.getValue("main.add")%></b>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.addline1")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="address1" value=""></td>
    <td><b><%=session.getValue("main.addstate")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="state"></td>
    </tr>
    <tr>
    <td align="right"><b><%=session.getValue("main.addline2")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="address2" onChange="this.form.finaladdress.value=this.form.address1.value + ';' + this.value;"> <input type="hidden" name="finaladdress"> </td>
    <td><b><%=session.getValue("main.addcity")%>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</b><input type="text" name="city"></td>
    </tr>
    <tr>
    <td align="right"> <b><%=session.getValue("main.addpin")%></b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="pincode">
    <td></td>
    </tr>
    <tr>
    <td ><b>7.)<%=session.getValue("main.const")%></b> <input type="text" name="constituency">
    <td ><b>8.)<%=session.getValue("main.id")%></b> &nbsp&nbsp<input type="text" name="refno">
    </tr>
    <tr>
    <td colspan="2"><center><input type="reset" name="reset" value="<%=session.getValue("button.reset")%>">&nbsp&nbsp<input type=submit name=Submit value="<%=session.getValue("button.submit")%>"></center></td>
    </tr>
    <tr>
    <td>
    </td>
    </tr>
    </form>
    </font>
    </BODY>
    </HTML>
    // verify.jsp
    <%@ page language="java" pageEncoding="UTF-8"%>
    <jsp:useBean id="verify" class="pack.verify" scope="request"/>
    <%@ page import="com.oreilly.servlet.*" %>
    <%@ page import="java.util.*,java.text.*" %>
    <%!
    MultipartRequest mp;
    // ParameterParser pp;
    %>
    <!-- Perform the actions on the bean. -->
    <%
    //pp.setCharacterEncoding("utf-8");
    %>
    <%
    try
    mp = new MultipartRequest(request, "d:/Files");
    out.println("DONE");
    /* Set the request object.*/
    /* The request object is implicitly available in the JSP page.*/
    verify.setRequest(mp);
    /* Insert the employee data into the database.*/
    verify.verifyEntry();
    //verify.setscope();
    /* Run the query to retrieve the employee data from the database.*/
    //logicbean.runQuery();
    catch (Exception e)
    System.out.println(e.getMessage());
    %>
    <HTML>
    <HEAD>
    <LINK href="theme/Master.css" rel="stylesheet" type="text/css">
    <TITLE>
    </TITLE>
    </HEAD>
    <BODY background="brown.bmp">
    <form name=form6 action="insertEntry.jsp" method="POST">
    <center>
    <table border=3>
    <tr>
    <td colspan=2><center><img src="asok.bmp"></center>
    </tr>
    <tr>
    <td >
    <b>1.)<%=session.getValue("main.ec")%></b>
    </td>
    <td rowspan=3>
    <image src="<%=verify.getpic()%>" width="85" hieght="85">
    </td>
    </tr>
    <tr>
    <td > &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.ecname")%></b> <%=verify.getvotername()%>&nbsp&nbsp<input type="hidden" value= "<%=verify.getvotername()%>" name="votername"></td>
    </tr>
    <tr >
    <td> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.ecsurname")%></b><%=verify.getvotersurname()%>
    <input type="hidden" value= "<%=verify.getvotersurname()%>" name="votersurname"></td>
    </tr>
    <tr>
    <td ><b>2.)<%=session.getValue("main.rel")%></b><input type="hidden" value= "<%=verify.getvoterrelation()%>" name="texthiddenrelation"></td>
    <td><%=verify.getvoterrelation()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.relname")%></b>&nbsp&nbsp&nbsp <input type="hidden" value= "<%=verify.getparentname()%>" name="parentname"></td>
    <td><%=verify.getparentname()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.relsurname")%></b><input type="hidden" value= "<%=verify.getparentsurname()%>" name="parentsurname"></td>
    <td><%=verify.getparentsurname()%></td>
    </tr>
    <tr>
    <td><b>3.)<%=session.getValue("main.sex")%></b><input type="hidden" value= "<%=verify.getsex()%>" name="texthiddensex"></td>
    <td><%=verify.getsex()%></td>
    </tr>
    <tr>
    <td ><b>4.)<%=session.getValue("main.age")%></B><input type="hidden" value= "<%=verify.getage()%>" name="age"></td>
    <td><%=verify.getage()%></td>
    </tr>
    <tr>
    <td><b>5.)<%=session.getValue("main.dob")%></b> <input type="hidden" value= "<%=verify.getdob()%>" name="mergedage"></td>
    <td> <%=verify.getdob()%></td>
    </tr>
    <tr>
    <td colspan=2><b>
    6.)<b><%=session.getValue("main.add")%></b></td>
    </tr>
    <tr>
    <td> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("verify.add")%></b><input type="hidden" value= "<%=verify.getadderess()%>" name="finaladdress"> </td>
    <td><%=verify.getadderess()%></td>
    </tr>
    <tr>
    <td >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.addpin")%></b><input type="hidden" value= "<%=verify.getpin()%>" name="pincode"></td>
    <td><%=verify.getpin()%></td>
    </tr>
    <tr>
    <td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<b><%=session.getValue("main.addstate")%></b><input type="hidden" value= "<%=verify.getstate()%>" name="state"></td>
    <td><%=verify.getstate()%></td>
    </tr>
    <tr>
    <td><b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<%=session.getValue("main.addcity")%></b><input type="hidden" value= "<%=verify.getcity()%>" name="city"></td>
    <td><%=verify.getcity()%></td>
    </tr>
    <tr>
    <td><b>7.)<%=session.getValue("main.const")%></b> <input type="hidden" value= "<%=verify.getconst()%>" name="constituency"></td>
    <td><%=verify.getconst()%></td>
    </tr>
    <tr>
    <td><b>8.)<%=session.getValue("main.id")%></b> <input type="hidden" value= "<%=verify.getrefno()%>" name="refno"></td>
    <td><%=verify.getrefno()%></td>
    </tr>
    <tr>
    <td colspan="2"><center><INPUT TYPE="button" VALUE="<%=session.getValue("ie.back")%>" onClick="history.go(-1)">
    <input type=submit name=Submit value="<%=session.getValue("button.submit")%>"></center><input type="hidden" value= "<%=verify.getpic()%>" name="pic"></td>
    </tr>
    </form>
    </BODY>
    </HTML>
    //verify.java
    package pack;
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.oreilly.servlet.*;
    import com.oreilly.servlet.ParameterParser.*;
    * @author Administrator
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class verify {
    String votername = "";
    String votersurname = "";
    String texthiddenrelation="";
    String parentname = "";
    String parentsurname = "";
    String gender = "";
    String texthiddensex="";
    String age = "";
    String dob = "";
    String mergedage="";
    String address = "";
    String finaladdress="";
    String pincode = "";
    String state = "";
    String city = "";
    String constituency = "";
    String refno = "";
    MultipartRequest request = null;
    Connection dbConn = null;
    ParameterParser pp;
    private String voternameParam;
    * Set the request object. This is used for getting parameters.
    public void setRequest(MultipartRequest request)
    this.request = request;
    public void verifyEntry()
    throws Exception
    /* Connect to the database.*/
    //pp.setCharacterEncoding("utf-8");
    //String nameParam = request.getParameter("name");
    MultipartRequest mp;
    System.out.println("connected to db2 through insertemployee");
    /* Get all the parameters from the calling HTML form.*/
    String voternameParam = request.getParameter("votername");
    System.out.println("the votername is " + request.getParameter("votername"));
    System.out.println(voternameParam);
    String votersurnameParam = request.getParameter("votersurname");
    System.out.println("the votersurname is " + request.getParameter("votersurname"));
    String hiddenrelationParam = request.getParameter("texthiddenrelation");
    System.out.println("the relation is " + request.getParameter("texthiddenrelation"));
    String parentnameParam = request.getParameter("parentname");
    System.out.println("the parentname is " + request.getParameter("parentname"));
    String parentsurnameParam = request.getParameter("parentsurname");
    System.out.println("the parentsurname is " + request.getParameter("parentsurname"));
    String ageParam = request.getParameter("age");
    System.out.println("the age is " + request.getParameter("age"));
    String mergedageParam = request.getParameter("mergedage");
    System.out.println("the mergedage is " + request.getParameter("mergedage"));
    String hiddensexParam = request.getParameter("texthiddensex");
    System.out.println("the hiddensex is " + request.getParameter("texthiddensex"));
    //String dobParam = request.getParameter("dob");
    //System.out.println("the dob is " + request.getParameter("dob"));
    String finaladdressParam = request.getParameter("finaladdress");
    System.out.println("the finaladdress is " + request.getParameter("finaladdress"));
    String pincodeParam = request.getParameter("pincode");
    System.out.println("the pincode is " + request.getParameter("pincode"));
    String stateParam = request.getParameter("state");
    System.out.println("the state is " + request.getParameter("state"));
    String cityParam = request.getParameter("city");
    System.out.println("the city is " + request.getParameter("city"));
    String constituencyParam = request.getParameter("constituency");
    System.out.println("the constituency is " + request.getParameter("constituency"));
    String refnoParam = request.getParameter("refno");
    System.out.println("the refno is " + request.getParameter("refno"));
    System.out.println("encoding = " + System.getProperty("file.encoding"));
    public String getvotername()
    return request.getParameter("votername");
    public String getvotersurname()
    return request.getParameter("votersurname");
    public String getvoterrelation()
    return request.getParameter("texthiddenrelation");
    public String getparentname()
    return request.getParameter("parentname");
    public String getparentsurname()
    return request.getParameter("parentsurname");
    public String getage()
    return request.getParameter("age");
    public String getsex()
    return request.getParameter("texthiddensex");
    public String getadderess()
    return request.getParameter("finaladdress");
    public String getpin()
    return request.getParameter("pincode");
    public String getstate()
    return request.getParameter("state");
    public String getcity()
    return request.getParameter("city");
    public String getconst()
    return request.getParameter("constituency");
    public String getrefno()
    return request.getParameter("refno");
    public String getdob()
    return request.getParameter("mergedage");
    public String getpic()
    //String a=request.getParameter("pic");
    //a=a.substring(a.lastIndexOf("/")+1);
    //System.out.print("Java path is "+a);     
    //Enumeration enum=request.getFileNames();
    //while(enum.hasMoreElements())
    //     String abc=(String)enum.nextElement();
    //     System.out.print("Java the path is "+abc);     
    return request.getParameter("pic");
    String votername1;
    //public void setScope()
    //request.setAttribute("votername1" ,voternameParam );
    //insertEntry.jsp
    <jsp:useBean id="logicbean" class="pack.logicbean" scope="request"/>
    <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
    <%@ page import="java.util.*,java.text.*" %>
    <%@ page import="com.oreilly.servlet.*" %>
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <!-- Perform the actions on the bean. -->
    <%
    request.setCharacterEncoding("UTF-8");
    %>
    <%
    try
    /* Set the request object.*/
    /* The request object is implicitly available in the JSP page.*/
    logicbean.setRequest(request);
    //MultiPartRequest mp=MultiPartRequest(request,"E:\Files");
    /* Insert the employee data into the database.*/
    logicbean.insertEntry();
    /* Run the query to retrieve the employee data from the database.*/
    //logicbean.runQueryInsert();
    catch (Exception e)
    System.out.println(e.getMessage());
    %>
    <HTML>
    <HEAD>
    <TITLE>
    Insert Record
    </TITLE>
    </HEAD>
    <BODY background="brown.bmp">
    <center><H2><%=session.getValue("ie.label")%>
    </H2>
    <font face = "Devanagari MT for IBM" size = +2>
    <b><%=session.getValue("ie.sd")%>|<%=session.getValue("ie.home")%></b>
    </font>
    </center>
    </BODY>
    </HTML>
    I have narrowed down the problem to the point where i understand that the "request.getParameter()" function for multipart is not able to understand or read UTF data properly. The out.println prints garbage from this function on the console. im using WAS
    plz help
    thanx in advance
    caffaine

    hi,
    To solve your problem Servlet Filters
    FILTER PROGRAM
    ===============
    package filters;
    import java.io.IOException;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.UnavailableException;
    public class SetCharacterEncodingFilter implements Filter {
    // ----------------------------------------------------- Instance Variables
    * The default character encoding to set for requests that pass through
    * this filter.
    protected String encoding = null;
    * The filter configuration object we are associated with. If this value
    * is null, this filter instance is not currently configured.
    protected FilterConfig filterConfig = null;
    * Should a character encoding specified by the client be ignored?
    protected boolean ignore = true;
    // --------------------------------------------------------- Public Methods
    * Take this filter out of service.
    public void destroy() {
    this.encoding = null;
    this.filterConfig = null;
    * Select and set (if specified) the character encoding to be used to
    * interpret request parameters for this request.
    * @param request The servlet request we are processing
    * @param result The servlet response we are creating
    * @param chain The filter chain we are processing
    * @exception IOException if an input/output error occurs
    * @exception ServletException if a servlet error occurs
    public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain)
         throws IOException, ServletException {
    // Conditionally select and set the character encoding to be used
    if (ignore || (request.getCharacterEncoding() == null)) {
    String encoding = selectEncoding(request);
    if (encoding != null)
    request.setCharacterEncoding(encoding);
         // Pass control on to the next filter
    chain.doFilter(request, response);
    * Place this filter into service.
    * @param filterConfig The filter configuration object
    public void init(FilterConfig filterConfig) throws ServletException {
         this.filterConfig = filterConfig;
    this.encoding = filterConfig.getInitParameter("encoding");
    String value = filterConfig.getInitParameter("ignore");
    if (value == null)
    this.ignore = true;
    else if (value.equalsIgnoreCase("true"))
    this.ignore = true;
    else if (value.equalsIgnoreCase("yes"))
    this.ignore = true;
    else
    this.ignore = false;
    // ------------------------------------------------------ Protected Methods
    * Select an appropriate character encoding to be used, based on the
    * characteristics of the current request and/or filter initialization
    * parameters. If no character encoding should be set, return
    * <code>null</code>.
    * <p>
    * The default implementation unconditionally returns the value configured
    * by the <strong>encoding</strong> initialization parameter for this
    * filter.
    * @param request The servlet request we are processing
    protected String selectEncoding(ServletRequest request) {
    return (this.encoding);
    web-xml entry
    +++++++++++
    <filter>     
         <filter-name>Set Character Encoding</filter-name>
    <filter-class>filters.SetCharacterEncodingFilter</filter-class>
              <init-param>
    <param-name>encoding</param-name>
    <param-value>UTF-8</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>

  • Page directive with UTF-8 charset??

    Hello,
              I try to implement the following jsp with weblogic. It displays A???C on the
              browser when the encoding is set to Unicode(UTF-8).
              When I change the browser encoding to Western European, it works fine.
              <html>
              <head>
              <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
              <title>Trying</title>
              </head>
              <body>
              <%
              String original = new String("A" + "\u696D" + "\u00f1" + "\u00fc" + "C");
              byte[] utf8bytes = original.getBytes("UTF8");
              String roundTrip = new String(utf8bytes, "UTF8");
              %>
              Original = <%=original %>
              RoundTrip = <%=roundTrip %>
              </body>
              </html>
              I found that it ignores the first two 00 when handle \u00xx character.
              However, if I add the following page directive at the beginning, it works
              fine.
              <%@ page contentType="text/html; charset=UTF-8" %>
              My question are
              1. why it trim the first two digit ("00")?
              2. what the weblogic did when I add the page directive?
              3. Is that mean the line <meta http-equiv.....> cannot work?
              4. Is there any alternative instead of adding the page directive line?
              I use WL6.1, win2000. Please help.
              Thanks a lot.
              Regards,
              kfchu
              

    String original = new String("A" + "\u696D" + "\u00f1" + "\u00fc" + "C");          > I found that it ignores the first two 00 when handle \u00xx character.
              > 1. why it trim the first two digit ("00")?
              I can't tell what you mean. According to the JLS, the "\uxxxx" construct is
              processed in a pre-lexical step. That means that your code is the same as
              writing:
              String original = new String("A" + "?" + "?" + "?" + "C");
              (Where I used a question mark instead of looking up and writing in the
              actual character values.)
              The reason why it is 00xx is that the "\u" construct requires the data in
              UTF16 format (the 2-byte encoding of Unicode characters which you know as
              Java's "char" type).
              To see how this data is encoded / decoded, you can look at the Java sources
              for java.io.DataInputStream and DataOutputStream.
              > 4. Is there any alternative instead of adding the page directive line?
              Yes! You can use the Response method directly:
              public void setContentType(java.lang.String type)
              (That's all that the JSP does anyway.)
              Peace,
              Cameron Purdy
              Tangosol Inc.
              Tangosol Coherence: Clustered Coherent Cache for J2EE
              Information at http://www.tangosol.com/
              "kfchu" <[email protected]> wrote in message
              news:[email protected]...
              > Hello,
              >
              > I try to implement the following jsp with weblogic. It displays A???C on
              the
              > browser when the encoding is set to Unicode(UTF-8).
              > When I change the browser encoding to Western European, it works fine.
              > ---------------------------------
              > <html>
              > <head>
              > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
              > <title>Trying</title>
              > </head>
              > <body>
              > <%
              > String original = new String("A" + "\u696D" + "\u00f1" + "\u00fc" + "C");
              > byte[] utf8bytes = original.getBytes("UTF8");
              > String roundTrip = new String(utf8bytes, "UTF8");
              > %>
              > Original = <%=original %>
              > RoundTrip = <%=roundTrip %>
              > </body>
              > </html>
              > -----------------------------------
              >
              > I found that it ignores the first two 00 when handle \u00xx character.
              > However, if I add the following page directive at the beginning, it works
              > fine.
              > <%@ page contentType="text/html; charset=UTF-8" %>
              >
              > My question are
              > 1. why it trim the first two digit ("00")?
              > 2. what the weblogic did when I add the page directive?
              > 3. Is that mean the line <meta http-equiv.....> cannot work?
              > 4. Is there any alternative instead of adding the page directive line?
              >
              > I use WL6.1, win2000. Please help.
              >
              > Thanks a lot.
              >
              > Regards,
              > kfchu
              >
              >
              

  • How to send Unicode to Oracle

    Hello,
    We have an intranet application that is live for sometime now. Our new requirement is to be able to store and view Japanese characters in some of the fields.
    We have Oracle 9.2.0.5 with NLS_CHARSET as UTF8. Our application server is WebLogic6.1sp6 on Solaris v5.8 64 bit.
    We use both thin driver (classes12.jar) and WebLogic 6.1 provided OCI thin driver, on different places of our application. The database column intended to store Japanese characters is just a VARCHAR and not NCHAR.
    I'm copying some Japanese characters from various websites and trying to input them in my application through browser. We are able to store Japanese characters, but they are occupying upto 8 bytes per character. Actually Unicode databases only should take upto 3 bytes per character. My requirement is to be able to store upto 1300 Japanese characters in a VARCHAR2(4000) field. Currently, it is only storing about 500 Japanese characters. When trying to store more than this, it is throwing a "java.sql.SQLException: Inserted value too large for column".
    I have already consulted Oracle and the reply I got is that it is not Oracle problem as the application needs to be changed so that it feeds physical UTF8 codepoints to Oracle. On their suggestion, I used iSQLPlus interface and was able to store 1300 Japanese characters in the database, by issuing an update statement. But the same data when seen from iSQLPlus is showing characters as follows: "& # 31258 ; & # 21481 ; & # 27470 ; & # 34507 ;" (I have added blanks so that your browser does not render it in Japanese). Hence they concluded that our application is NOT using UTF8 codpoints but a HTML based representation system using the ""& #" and then the unicode identifier for that character. For Oracle this is NOT a character, It's a string of 8 characters and hence it occupies 8 bytes. Please help me on how to feed UTF8 codepoints to Oracle?
    I have already tried putting NLS_LANG=AMERICAN_AMERICA.UTF8 in my WebLogic startup script. I also tried putting
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> in my JSP's. (This actually makes the problem even worse that it displays junk instead of Japanese while retrieving).
    Are there any other special settings that I need to be able to store Unicode characters? Please help.
    Thanks
    Varma
    [email protected]

    thanks the following steps did the trick
    1. I put the following info in weblogic.xml
    <charset-params>
    <input-charset>
    <resource-path>/*</resource-path>
    <java-charset-name>UTF8</java-charset-name>
    </input-charset>
    </charset-params>
    2. I added the weblogic.codeset=UTF8 for the WebLogic Oracle OCI connection pool
    3. I added the nls_charset12.zip in the CLASSPATH for the Oracle thin driver that I'm using.
    4. Added the <%@ page contentType="text/html; charset=utf-8"%> (Somehow the <jsp-param><encoding> tag does not work in weblogic.xml)

  • JSTL unicode xml does not display after x:parse call

    I am trying to display an xml file on the web using JSTL xml tags. The file is encoded in utf-8 containing ancient Greek characters (x1f92, etc.). The file displays properly from a servlet + xslt (http://163.1.169.41/testapp), but I want to use JSTL.
    The JSTL produces intricate spaghetti on the screen (e.g. ��������������� ). I have seen this before --it would seem that unicode is indeed being directed at the screen but is not being interpreted properly. (Not strings of question marks mind you; the unicode seems to be there in this case).
    The code producing the spaghetti is below. I am just dumping in on the screen for now and will use xpath calls later for more precise extraction.
    Does the JSTL want character entities for the x arse call? I would not think so: parsing a utf-8 file would be a very common operation. How can I get the xml unicode file to display properly using the JSTL below?
    [headers]
    <%@ page contentType="text/html; charset=utf-8"pageEncoding="utf-8" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <c:import var="papyrus" url="blabula.xml" />
    <x:parse var="doc" xml="${papyrus}" />
    <x:out select="$doc" />
    ....

    Is it the parse or the import tag that is at fault?
    Try just printing the results of the <c:import> and see what it produces.
    you might try <c:import var="papyrus" url="blabula.xml" charEncoding="utf-8" />

  • Plz its URGENT : Storing unicode data in MS SQL Server 2000 through JSPs

    Hello All,
    I'm trying to store unicode data, entered from JSP page into the SQL Server. For that I've tried the following :
    1> I put tag -
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    2> Also set in JSP tag -
    <%@page contentType="text/html;charset=UTF-8"%>
    But, still data is being entered in ISO-8859-1 format, don't know why. I tried with function for convertion - private String toUniCode(String strPar)-it successfully shows me the unicode data in alret msg, but it doesn't enters unicode data in SQL Server. In SQL Server only '??????' get entered. I kept data-type in SQL Server as nvarchar to store data in unicode.
    Would it be possible for me, to accept the data as UTF-8 itself & can I store it in SQL Server as it is? How can I do that? I'm accepting data in 'marathi' language.
    Plz, anybody Help me, I'm trying for this from around more than 1 week.
    Thanks in advance for any replies!

    Hello dmorris800,
    Thanx for your help. In fact I've tried lot many alternatives for that. Later I realised that it was problame of Driver, not of code. I was using jdbc:odbc driver which doesn't support unicode, or I don't know what was the problame with it.
    But I downloaded the driver named :'TaveConnect30C'. It is the connection optimised driver of Atinav.com This is the JDBC3 Type 4 Driver for MS SQL Server 6.5/7.0/2000 & trial version of which can be downloaded from http://www.atinav.com/download.htm
    It is really very good type-4 Driver.
    Cheers
    -Yogesh

  • Unicode help...

    Hi,
    Im having some problems with unicode and did all the necessary things shown below:
    1. Add <%@page contentType="text/html" pageEncoding="UTF-8"%> to JSP
    2. Set response.setContentType("text/xml;charset=UTF-8");
    3. As im using httpUrlConnection to connect, i also add URIEncoding to my server.xml.
    4. I also set unicodetStr = new String(str.getBytes("ISO-8859-1"),"UTF-8");
    The problem is that when I entered chinese words in my JSP, the values become ??? and it it being store in my database. After I restart my tomcat, the chinese words are able to store correct(in chinese) in my database. When I try again the next day, the same data become ??? again. Does anyone know how can i solve this?
    Im using tomcat 5.5.20 on linux and my database is orcacle.
    Grace

    You look at the filter :
    package com.lin.ums.web;
    import java.io.IOException;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    public class CharacterEncodingFilter implements Filter
    private FilterConfig config;
    public void init(FilterConfig config) throws ServletException
    this.config = config;
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
    String encoding = config.getInitParameter("encoding");
    if(encoding == null)
    encoding = "gbk";
    request.setCharacterEncoding(encoding);
    response.setCharacterEncoding(encoding);
    chain.doFilter(request, response);
    public void destroy()
    Then you add in web.xml:
    <filter>
    <filter-name>CharacterEncodingFilter</filter-name>
    <filter-class>com.lin.ums.web.CharacterEncodingFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>CharacterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

  • Multilingual JSP page

    I am trying to build a multilingual web page using ResourceBundle class.
    What I want is to have the table title to be multilingual. I have defined
    two properties files "title_en_US.properties" and "title_zh_CN.properties".
    I have earlier used the native2ascii tool to convert the chinese characters
    to string as shown below for the chinese properties file
    name=\u00e5\u00b8\ufffd\u00e5\ufffd\u00b7
    In my "Load.jsp", I notice that in IE 5.5 it will display
    the chinese title as garbage character as the page content type
    is defaulted to Western ISO language encoding.
    If I manually change encoding to Unicode using via the IE menu with
    steps "View/Encoding/Unicode", the garbage characters becomes Chinese.
    I tried to have another JSP "LoadUTF8.jsp" which specifies the page encoding
    as UTF-8. The IE browser shows the page encoding defaults to Unicode but
    the chinese title is still displayed as garbage characters.
    Where did I go wrong? Any help on this is much appreciated.
    Thank you.
    Regards,
    Chee Keong
    Here is a brief code of the "Load.jsp" JSP
    <%@ page language="java" contentType="text/html" %>
    <%@ page import="java.util.Locale" %>
    <%@ page import="java.util.ResourceBundle" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <!-- Load.jsp -->
    <%
    Locale mylocale = null;
    String language = request.getParameter("lang");
    if ("zh".equalsIgnoreCase(language))
    mylocale = new Locale("zh","CN");
    else
    mylocale = new Locale("en","US");
    ResourceBundle bundle = ResourceBundle.getBundle("title", mylocale);
    %>
    <head>
    <title>Testing</title>
    </head>
    <body>
    <h3> Welcome </h3>
    <table border="1">
    <tr><td><%= bundle.getString("name") %></td></tr>
    </table>
    </body>
    </html>
    Here is a brief code of the "LoadUTF8.jsp" JSP
    <%@ page contentType='text/html; charset=UTF-8' %>
    <%@ page import="java.util.Locale" %>
    <%@ page import="java.util.ResourceBundle" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <!-- LoadUTF8.jsp -->
    <%
    Locale mylocale = null;
    String language = request.getParameter("lang");
    if ("zh".equalsIgnoreCase(language))
    mylocale = new Locale("zh","CN");
    else
    mylocale = new Locale("en","US");
    ResourceBundle bundle = ResourceBundle.getBundle("title", mylocale);
    %>
    <head>
    <title>Testing</title>
    </head>
    <body>
    <h3> Welcome </h3>
    <table border="1">
    <tr><td><%= bundle.getString("name") %></td></tr>
    </table>
    </body>
    </html>

    I'm not sure what is wrong with your code, but here's a test JSP page I was using to test Chinese input and display:
    <%@ page language="java" contentType="text/html; charset=UTF-8" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title></title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         <meta name="Generator" content="TextPad 4.0" />
         <meta name="Author" content="" />
         <meta name="Keywords" content="" />
         <meta name="Description" content="" />
    </head>
    <body bgcolor="#ffffff" background="" text="#000000" link="#ff0000" vlink="#800000" alink="#ff00ff">
    <%
    request.setCharacterEncoding("UTF-8");
    String str = "\u7528\u6237\u540d";
    String name = request.getParameter("name");
    if(name != null) {
         // instead of setCharacterEncoding...
         //name = new String(name.getBytes("ISO8859_1"), "UTF8");
    System.out.println(application.getRealPath("/"));
    System.out.println(application.getRealPath("/src"));
    %>
    req enc: <%= request.getCharacterEncoding() %><br />
    rsp enc: <%= response.getCharacterEncoding() %><br />
    str: <%= str %><br />
    name: <%= name %><br />
    <form method="GET" action="_lang.jsp" encoding="UTF-8">
    Name: <input type="text" name="name" value="" >
    <input type="submit" name="submit" value="Submit" />
    </form>
    </body>
    </html>

  • Problems with Unicode webapplication

    Hi,
    I am developping a small webapplication which is supposed to support Unicode (different characters such as �S�\ etc.).
    I have a simple form which calls a JSP page.
    The JSP page prints the recieved parameter and prints it to the WEB browser.
    The JSP page also prints the parameter to a file.
    If I use:
         String textIn= request.getParameter("unicodeText");
         byte d[]=new byte[textIn.length()];
         textIn.getBytes(0, textIn.length(), d, 0);
         String unicodeText = (new String(d,"UTF-8"));Everything works fine but if I use:
         byte[] bytes = request.getParameter("unicodeText").getBytes();
         String unicodeText= new String(bytes, "UTF-8");OR:
         byte[] bytes = request.getParameter("unicodeText").getBytes("UTF-8");
         String unicodeText= new String(bytes, "UTF-8");OR:
         byte[] bytes = request.getParameter("unicodeText").getBytes("UTF-8");
         String unicodeText= new String(bytes);The parameter retrieved by the JSP page contains strange characters (such as a box followed by a questionmark) when I submit for example '�\' and '�S'.
    The problem is that the method:
    getBytes(0, textIn.length(), d, 0);used in the working example is Deprecated. In the API documentation I am told that the getBytes()
    Deprecated. This method does not properly convert characters into bytes. As of JDK 1.1, the preferred way to do this is via the the getBytes() method, which uses the platform's default charset.
    I really do not know why I can not get it to work!
    /Fredrik

    Ha again,
    I installed resin and started it with the default
    configuration and changed my jsp file as follows:
    byte[] bytes =
    request.getParameter("unicodeText").getBytes("UTF-8");
    String unicodeText= new String(bytes, "UTF-8");
    What you are doing is unnecessary (but should still work). Instead, simply write:
    String unicodeText = request.getParameter("unicodeText");as the unicode string has already been decoded by the jsp container.
    and this gives the wanted result (i.e. it works).
    I have tried around 20 chineese characters and �
    � and �.
    There is only one small thing... all combinations of
    � � and � works except
    ��� in this order.Really? I have tried the same character sequence (with your above code, and with my simplified version) and both work. Here is my test page:
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page session="false" %>
    <html>
    <head>
      <title>Test encodings</title>
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
    </head>
    <br />
    <br />
    Request parameters:<br />
    <%
       java.util.Map params = request.getParameterMap();
       for (java.util.Iterator i = params.keySet().iterator(); i.hasNext(); ) {
         String param = (String) i.next();
         String[] values = request.getParameterValues(param);
         out.write("<b>" + param + "=[</b>");
         for (int j = 0; j < values.length; j++) {
           if (j > 0) {
             out.write("<b>,</b>");
           out.write(values[j]);
         out.write("<b>]</b> ");
    %>
    <body bgcolor="#ffffff" text="#000000"
      link="#006699" vlink="#006699" alink="#006699" leftmargin="0" topmargin="0"
      marginheight="0" marginwidth="0">
      <table border="0" align="left">
       <tr><th colspan="2">Enter some values</th></tr>
       <form method="post"
        action="testenc2.jsp"
        <%-- enctype="multipart/form-data" --%>
        >
        <input type="hidden" name="hidden" value="hidden_val" />
        <tr>
         <td>name</td>
         <td>
          <input type="text" name="name" size="50" maxlength="100"/></td>
        </tr>
        <tr>
         <td>address</td>
         <td>
          <input type="text" name="address" size="15" maxlength="20"/>
         </td>
        </tr>
        <tr>
         <td colspan="2">
         <input type="submit" name="cmd" value="send" />
         <input type="submit" name="cmd" value="cancel" />
         </td>
        </tr>
       </form>
      </table>
    </body>
    </html>>
    Anyway, this is a minor problem.
    Now I have to figure out why it works with resin but
    nor with jakarta.tomcat....Doesn't tomcat have a mailing list? That's probably a good place to ask or search.

  • [UPDATED WORKAROUND] SEVERE unicode/ UTF-8 ADFm bidnig/invokation problem

    I have BIG problem with very simple search page use-case (with one text input field, search button and af:table for results). It looks like the unicode input value is somehow ruined during PPR and model update cycle (the unicode value is internally collated to ascii while transferred to EJB method)!!!
    Here is the scenario (please note that all was created by pure drag-and-drop from Data Controls palette):
    I have one inputText field on page, value of which is bound to simple attribute binding (say #{bindings.key.inputValue}) which is bound to vKey variable.
    In PageDef I have methodIterator with
    <methodIterator Binds="XYZ.result" Refresh="always" ...(the XYZ is method in some EJB) and I have adequate methodAction XYZ defined with named param:
    <NamedData NDName="key" NDValue="${bindings.vKey}" NDType="java.lang.String"/>The table is bound to tree binding bound to the above methodIterator. The button is PPR trigger for table (only thing nod done by drag-and-drop).
    JSPX page is xml encoding="UTF-8" with:
    <jsp:directive.page contentType="text/html;charset=UTF-8"
                           pageEncoding="UTF-8"/>There are no locale settings in faces-config.xml (the default config).
    In inputText I entered some unicode input text like "ЧШЩЪ".
    When button is clicked, the methodAction XYZ is invoked.
    The debugger brake-point is set inside EJB method.
    Now, during the PPR after button click, the EJB method brake-point is hited twice (I assume because the Refresh="always" for methodIterator). In firs hit, the value of key parameter is OK (correct unicode value visible in Inspect...). BUT, the second time (during the same PPR) the method is invoked WITH totally ruined value of "????"! Of course, the search didn't find anything...
    Thus, not only that problem of unicode is related to localization of pages/resources but something strange is happening with value binding also.
    Can someone help?
    Message was edited by:
    PaKo
    Message was edited by:
    PaKo

    Another way around:
    Instead using processScope or pageFlowScope (which is not releasing memory automatically so it may make you a problems further on), I discovered an alternative workaround:
    instead binding to #{bindings.someAttribBinding.inputValue} (which suffers from UTF-8 bug as concluded), you can bind your text inputs directly to #{bindings.someIterator.currentRow.dataProvider. someAttribute } which binds directly to your underlying data source property.
    In my case, I use EJBs so the underlying datasource is Entity bean and this way I bind directly to setter method thus overriding any ADFm interference.
    This shows to be more reliable and also MORE EFFICIENT! In case of indirect (via buggy attribute) binding, the getter method in entity is called twice while in case of direct binding (through .currentRow.dataProvider.someAttribute) the getter is called only once per page lifecycle (the setter is called once in both cases).
    I would, thus, suggest to ADF team to consider introduction of some sort of better support for direct binding to the underlying data sources instead through Iterators and Attribute bindings. On example, introduce Entity Binding (like Tree binding, but with direct support for access to entity attributes including parent/children collections). This also apply for list bindings where it is NECESSARY to enable object binding from list to entity attribute (as EJB entities don't know for foreign keys but for related entities so the attribute mapping supported with current list bindings is totally useless).
    Regards,
    Pavle

  • Unable to print 'Chinese' through JavaScript.....It is throughing Unicode

    Hi experts,
    I am unable to display 'chinese' characters through Javascript. For example the following statement is giving unicode characters, rather than chinese.
    alert("<%= bundle.getString("welcome")%>");
    The following statement giving Chinsese output as expected.
    <%= bundle.getString("welcome") %>
    Inorder to output 'Chinese' through JavaScript, what have to i do ??
    Please let me know if there is any document on this...

    Dear Srinivas,
    I have tested the situation that you mentioned. It is ok to call javascript to display chinese.
    Have you forget to add following line ?
    <%@ page contentType="text/html;charset=utf-8" %>
    By default, jsp use ISO_8859_1 as charset.
    Also you can download the following package and check whatever your chinese bytes are correct by using printBytes() .
    http://www.angelfire.com/amiga/yores/
    M.T.

  • Help me...unicode

    I have two pages:
    First one is a html form page. Source like this:
    Send.html
    <html><head><title>Unicode Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
    <body>
    <form method="post" action="Receive.jsp">
    <input type="text" name="txtSend"><BR>
    <input type="submit" name="Submit" value="Submit"></BR>
    </form>
    </body>
    </html>
    Second one is a jsp page. Source like this:
    Receive.jsp:
    <%@ page contentType="text/html;charset=UTF-8"%>
    <html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
    <body>
    String txtReceive = request.getParameter("txtSend");
    byte buff[] = txtReceive.getBytes("ISO-8859-1");
    String txtFinal = new String(buff,"UTF-8");
    out.print(txtFinal);
    </body>
    </html>
    The input string (in html page) is a unicode string (in Vietnamese), but the output string (in jsp page) is always junk characters. I don't know why?
    Thanks for everyone.
    pvthem

    I have tried your code but with:
    out.println("<font face=\"Arial\">" + text + "</font>");
    Everything is right. I am using Tomcat 3.2.1. You can get right result if you change font of browser to Arial (IE and Netscape).
    Good luck.
    nqthanh

  • JSP to display Chinese From Oracle Unicode?

    My Oracle 9iR2 Database use Unicode as default character set.
    However, I can not see Chinese from JSP and use <%@ page contentType = "text/html;charset=UTF-8" %>.
    What is the solution to i18n?

    Hi,
    Why can't you use a Java Bean which takes the data from the database. Then call this bean from the JSP page using <jsp:useBean> tag.
    Ok,if you dont want a Java Bean and if you want to use an applet in a JSP file, you will have to use <jsp:plugin>tag. Here is an example
    <html><head><title> Demo Applet</title></head>
    <body bgcolor="rd">
    <% if (request.getParameter("SUBMIT") != null) {%>
    <jsp:plugin type="applet" code="DemoApplet.java" codebase="." name="Demo" height="400 with="300>
    <jsp:fallback> Plug in not supported by your browser</jsp:fallback>
    </jsp:plugin>
    </body></html>
    Hope this will help you.
    Rgds,
    Ravi Shankar

  • Java.lang.NoSuchFieldError: ADFM_SINGLE_DC_FRAME Error While Running a Page

    Hi
    I am having a simple JSF Page when i try to run the page in Jdev 11g i am getting the following exception
    JSF Page Code:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" binding="#{backingBeanScope.backing_ContactList.d1}">
          <af:messages binding="#{backingBeanScope.backing_ContactList.m1}"
                       id="m1"/>
          <af:form id="f1" binding="#{backingBeanScope.backing_ContactList.f1}">
            <af:panelStretchLayout binding="#{backingBeanScope.backing_ContactList.psl1}"
                                   id="psl1">
              <f:facet name="bottom"/>
              <f:facet name="center"/>
              <f:facet name="start"/>
              <f:facet name="end"/>
              <f:facet name="top"/>
            </af:panelStretchLayout>
          </af:form>
        </af:document>
      </f:view>
      <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_ContactList-->
    </jsp:root><pre>
    Target URL -- http://127.0.0.1:7101/DataBoundApp-ViewController-context-root/faces/ContactList.jspx
    <Feb 5, 2010 11:44:54 AM GMT+05:30> <Error> <HTTP> <BEA-101020> <[ServletContext@1038384[app:DataBoundApp module:DataBoundApp-ViewController-context-root path:/DataBoundApp-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
    java.lang.NoSuchFieldError: ADFM_SINGLE_DC_FRAME
         at oracle.adf.model.BindingContext.getCurrentFrame(BindingContext.java:1930)
         at oracle.adf.model.BindingContext.setSessionContext(BindingContext.java:448)
         at oracle.adf.model.BindingRequestHandler.initializeBindingContext(BindingRequestHandler.java:371)
         at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:182)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:189)
         Truncated. see log file for complete stacktrace
    >
    <Feb 5, 2010 11:44:54 AM GMT+05:30> <Notice> <Diagnostics> <BEA-320068> <Watch 'UncheckedException' with severity 'Notice' on server 'DefaultServer' has triggered at Feb 5, 2010 11:44:54 AM GMT+05:30. Notification details:
    WatchRuleType: Log
    WatchRule: (SEVERITY = 'Error') AND ((MSGID = 'BEA-101020') OR (MSGID = 'BEA-101017') OR (MSGID = 'BEA-000802'))
    WatchData: DATE = Feb 5, 2010 11:44:54 AM GMT+05:30 SERVER = DefaultServer MESSAGE = [ServletContext@1038384[app:DataBoundApp module:DataBoundApp-ViewController-context-root path:/DataBoundApp-ViewController-context-root spec-version:2.5]] Servlet failed with Exception
    java.lang.NoSuchFieldError: ADFM_SINGLE_DC_FRAME
         at oracle.adf.model.BindingContext.getCurrentFrame(BindingContext.java:1930)
         at oracle.adf.model.BindingContext.setSessionContext(BindingContext.java:448)
         at oracle.adf.model.BindingRequestHandler.initializeBindingContext(BindingRequestHandler.java:371)
         at oracle.adf.model.BindingRequestHandler.beginRequest(BindingRequestHandler.java:182)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:189)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    SUBSYSTEM = HTTP USERID = <WLS Kernel> SEVERITY = Error THREAD = [ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)' MSGID = BEA-101020 MACHINE = HARIKEMPULA TXID = CONTEXTID = TIMESTAMP = 1265350494331
    </pre>
    can anybody please tell me what is the issue.

    Any body please help me on this. i am not getting why this error is coming?
    Regards
    Hari

Maybe you are looking for

  • I have remote desktop and need to log in to an off site windows PC?

    I have remote desk top and am trying to log in to a windows server off site.  How do I do this?

  • Report RFKOPR10 has to dispaly  Net amounts, excluding VAT

    Hi, Currently the Report  RFKOPR10 is displaying the  aging for  5 periods:                                                                                 -Aging 0-30 days                                                                              

  • Call a  Webservice method from DotNetApplication

    Hi all, I have created One web service using Axis. My WebServices are below: import java.util.*; public class NHLService {   HashMap standings = new HashMap();   public NHLService() {     // NHL - part of the standings as per 04/07/2002     standings

  • Cant open cd-rw on desktop

    can anyone help me ...i can burn a cd-rw on my e mac just fine ......open up on a pc and see the information , but it wont appear on my computer. any suggestions as to why or how i can fixed this ? cd-r seem to be fine, but not a re recordable disc

  • Image Content Item not available

    I am trying to add a new image content in Site Studio. I Click on the "New" icon -> "Copy" -> "From Local", choose the image (jpeg) and Fill Out the "Check-In" form. I see that the new content Item is added in the list of Images. 1) I refresh the lis