Ask Experts Questions for FREE Help !
Ask
    MGangrade's Avatar
    MGangrade Posts: 1, Reputation: 1
    New Member
     
    #1

    Mar 28, 2014, 10:53 AM
    Java
    I have a jsp page which takes up first name and last name in chinese language. I am using the struts framework.
    I need to pass the first name and last name from the JSP to servlet in terms of unicode characters.
    I am doing the following changes:
    JSP Changes:I have a jsp page which takes up first name and last name in chinese language. I am using the struts framework.
    I need to pass the first name and last name from the JSP to servlet in terms of unicode characters.
    I am doing the following changes:
    JSP Changes:
    1) <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
    2) meta content="content-type" content="text/html; charset=utf-8" in the header,

    The filter which is called before the action servlet, I have used the following code:
    request.setCharacterEncoding("UTF-8");
    response.setContentType("UTF-8");

    This did not work, the unicode characters which are passed are incorrect, or something not readable.

    Considering the MVC framework already creates the request object by the time it reaches the filter,
    I modified the JSP to include the following lines of code
    <%@ taglib uri="Oracle Technology Network for Java Developers | Oracle Technology Network | Oracle" prefix="fmt" %>
    < fmt:requestEncoding value=" %>
    < fmt:requestEncoding value=" />
    < fmt:setLocale value="zh_CN"/>

    None of the above changes have worked. Please help me to get the correct unicode characters in the action class.
    IS there any modification I need to make in the config files.

    1) <%@ page pageEncoding=" />
    < fmt:setLocale value=" contentType="/>

    None of the above changes have worked. Please help me to get the correct unicode characters in the action class.
    IS there any modification i need to make in the config files.

    1) <%@ page pageEncoding=" %>
    2) meta content=" contentType=" content=" %>
    2) meta content=" in the header,

    The filter which is called before the action servlet, I have used the following code:
    request.setCharacterEncoding(" content=");
    response.setContentType(" in the header,

    The filter which is called before the action servlet, I have used the following code:
    request.setCharacterEncoding(");

    This did not work, the unicode characters which are passed are incorrect, or something not readable.

    Considering the MVC framework already creates the request object by the time it reaches the filter,
    I modified the JSP to include the following lines of code
    <%@ taglib uri="Oracle Technology Network for Java Developers | Oracle Technology Network | Oracle");
    response.setContentType("fmt" %>
    < fmt:requestEncoding value=");

    This did not work, the unicode characters which are passed are incorrect, or something not readable.

    Considering the MVC framework already creates the request object by the time it reaches the filter,
    I modified the JSP to include the following lines of code
    <%@ taglib uri=" />
    < fmt:setLocale value="zh_CN"/>

    None of the above changes have worked. Please help me to get the correct unicode characters in the action class.
    IS there any modification I need to make in the config files.

Check out some similar questions!

Java netbeans program- Connection between java and mysql,How to conn [ 0 Answers ]

which I wrote from a book but when I run it, it shows exception please give me the code to connect jlistbox to database when I click on btn1. btn coding should search "name" in database and shows all the names in listbox my coding: here-- r1,r2,r3 are radio btns and l1,l2,l3 are labels,...

Ask for help in java [ 0 Answers ]

Hi guys can you help me on java. I want to add some data on a jcombobox from mysql database. I created 2 comboboxes. After I retrieve the necessary data from the database it will automatically fill up the first combobox. And then in the first combobox the user chooses the data he wants...

About java [ 1 Answers ]

While using a predefined class we should import the packages like import java.io.*,but I have used the predefined class System.out.print without importing any package.. how is it possible.. and how does it works?

Java Is used for [ 2 Answers ]

When I rest my pointer over a link, it diplays information about that link Is that Java at work? Why are there different Jav versions? Is Java compiled like C or interpeted like Basic? Is this contained in Internet Explorer? Thank You very much


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.