Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7278463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:52:41+00:00 2026-05-28T22:52:41+00:00

I am building web application using Spring MVC Spring Security Hibenate MySQl I want

  • 0

I am building web application using

  1. Spring MVC
  2. Spring Security
  3. Hibenate
  4. MySQl

I want to add internationalization support to my application.e.g. I want to store and retrive japanese characters to mySQL db using Hibernate.

I have set DB charset to UTF-8 and also added property to hibernate-cfg.xml

property name=”hibernate.connection.characterEncoding”>UTF-8

I have done simple POC in which from java file , I am able to declare some string variable with japanese characters and they are successfully inserted into DB and search by japanese characters is also working fine.

But when on JSP file , i fill up form, all field value are passed to controller in form of POJO, and all japansese characters in POJO’s field are sutomatically converted into numerical character references as mentioned in below example,

CreateUser.jsp

<form:form method="post" commandName="userModel">
    <%@include file="/tp/web/iBusinessException.jsp"%>
    <table width="700" border="0" align="center" cellpadding="4"
        cellspacing="0">
        <tr>
            <td class="tdWscHeading">
                <img
                    src="<%=request.getContextPath()%>/tp/web/console/include/images/iconCreateuser.gif"
                    alt="Task Summary" width="20" height="20" align="absmiddle">
                <spring:message code='label.createuser'></spring:message>
            </td>
        </tr>
    </table>
    <table width="700" border="0" align="center" cellpadding="4"
        cellspacing="1" class="tableWscmain">
        <tr>
            <td width="250" class="tdWscContent fontBold">
                <spring:message code='label.firstname'></spring:message>
                <span class="fontRed"> *</span>
            </td>
            <td class="tdWscContent">
                <form:input path="firstname" cssClass="formINPUT"
                    autocomplete="off" />
                <!-- Error Message if Key is Empty Starts -->

                <span class="error"> <spring:bind path="firstname">
                        <c:if test="${not empty status.errorMessage}">
                            <c:out value="${status.errorMessage}" escapeXml="false" />
                        </c:if>
                    </spring:bind> </span>
                <!-- Error Message if key is Empty Ends -->
            </td>
        </tr>
        <tr>
            <td class="tdWscContent fontBold">
                <spring:message code='label.lastname'></spring:message>
                <span class="fontRed"> *</span>
            </td>
            <td class="tdWscContent">
                <form:input path="lastname" cssClass="formINPUT"
                    autocomplete="off" />
                <!-- Error Message if Key is Empty Starts -->
                <span class="error"> <spring:bind path="lastname">
                        <c:if test="${not empty status.errorMessage}">
                            <c:out value="${status.errorMessage}" escapeXml="false" />
                        </c:if>
                    </spring:bind> </span>
                <!-- Error Message if key is Empty Ends -->
            </td>
        </tr>
        <tr>
            <td class="tdWscContent fontBold">
                <spring:message code='label.username'></spring:message>
                <span class="fontRed"> *</span>
            </td>
            <td class="tdWscContent">
                <form:input path="username" cssClass="formINPUT"
                    autocomplete="off" />
                <!-- Error Message if Key is Empty Starts -->
                <span class="error"> <spring:bind path="username">
                        <c:if test="${not empty status.errorMessage}">
                            <c:out value="${status.errorMessage}" escapeXml="false" />
                        </c:if>
                    </spring:bind> </span>


                <!-- Error Message if key is Empty Ends -->
            </td>
        </tr>
        <tr>
            <td class="tdWscContent fontBold">
                <spring:message code='label.password'></spring:message>
                <span class="fontRed"> *</span>
            </td>
            <td class="tdWscContent">
                <form:password path="password" cssClass="formINPUT"
                    autocomplete="off" showPassword="false" />
                <!-- Error Message if Key is Empty Starts -->
                <span class="error"> <spring:bind path="password">
                        <c:if test="${not empty status.errorMessage}">
                            <c:out value="${status.errorMessage}" escapeXml="false" />
                        </c:if>
                    </spring:bind> </span>
                <!-- Error Message if key is Empty Ends -->
            </td>
        </tr>
        <tr>
            <td class="tdWscContent fontBold">
                <spring:message code='label.email'></spring:message>
                <span class="fontRed"> *</span>
            </td>
            <td class="tdWscContent">
                <form:input path="email" cssClass="formINPUT"
                    autocomplete="off" />
                <!-- Error Message if Key is Empty Starts -->
                <span class="error"> <spring:bind path="email">
                        <c:if test="${not empty status.errorMessage}">
                            <c:out value="${status.errorMessage}" escapeXml="false" />
                        </c:if>
                    </spring:bind> </span>
                <!-- Error Message if key is Empty Ends -->
            </td>
        </tr>

        <tr>
            <td class="tdWscContent fontBold">
                <spring:message code='label.groupname'></spring:message>
                <span class="fontRed"> *</span>
            </td>
            <td class="tdWscContent">
                <select id="groupname" name="groupname">
                    <c:forEach items="${GROUPS_LIST_RESULT}" var="option">
                        <option value='<c:out value="${option.groupname}" />'>
                            <c:out value="${option.groupname}" />
                        </option>
                    </c:forEach>
                </select>
                <!-- Error Message if Key is Empty Starts -->
                <span class="error"> <form:errors path="groupname"></form:errors>
                </span>
                <!-- Error Message if key is Empty Ends -->
            </td>
        </tr>

        <tr align="center">
            <td colspan="2" class="tdWscContent fontBold">
                <input type="submit" name=""
                    value="<spring:message code="label.createuser"></spring:message>">
            </td>
        </tr>
    </table>
</form:form>

MyController

@RequestMapping(value = USERADMINISTRATION_NAMESPACE + "/createUser.do", method = RequestMethod.POST)
public ModelAndView submitCreateUserPage(
        @ModelAttribute("userModel") User user, BindingResult result

) throws UserAlreadyExistsException {
    String password = "";
    password = user.getPassword();

/* Here , password i am getting like **&#164;** ,  */
/* I want exactly same Japanese characters as entered by user */
}

I have not use any character encoding filter in my application.

From jsp to controller , it is automatically converted into such above number..
I want exactly same Japanese characters as entered by user in jsp and want to insert same into DB and display on page.

I am passing all user input field’s value from JSP to controller as a POJO.

Please help…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T22:52:42+00:00Added an answer on May 28, 2026 at 10:52 pm

    Finally I succeed in implementing internationalization support in my Spring MVC based application….

    I have followed below steps to incorporate internationalization support to my web application using Spring MVC, Hibernate , MYSQL or Oracle Database and Jboss or webLogic as a application server.

    Let’s say we want to add internationalization support for Japanese language.i.e user should be able to enter Japanese characters in web forms and it should be saved in same format as entered by user and also should be displayed in same language on web page.

    Follow below steps.

    1. Make sure you have Japanese language support (Region specific installation) installed into operating system. If not, please install it.

    2. If you are using any IDE then configure IDE to support Japanese language by changing text encoding to UTF-8. For example,If you are using my Eclipse then change text file encoding to UTF-8. You can change by this path (Window->Preference->General->Workspace)

    3. Place Spring framework’s in built character encoding filter as a first filter in filter chain (web.xml) to make sure it runs first during request processing and runs last during response processing

    web.xml

    <filter>  
        <filter-name>encodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
        <param-name>encoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
        <!-- set forceEncoding to true if you want to override encoding of servlet -->
        <param-name>forceEncoding</param-name>
        <param-value>true</param-value> 
    </init-param>
    

    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    

    4 Set JSP Page encoding to UTF-8 by adding below mentioned code at top of JSP.


    <%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    

    5 Set Hibernate connection encoding scheme to UTF-8 by adding following property to hibernate-cfg.xml

    <property name="hibernate.connection.characterEncoding">UTF-8</property>
    

    Note : If using JBoss application server, please make sure you have appended characterEncoding=UTF-8 to connection-url in database service configuration file
    (For ex. mysql-ds.xml for mySQL database) as mentioned below.

    <datasources>
    
    <local-tx-datasource>
    
        <jndi-name>WSCDS</jndi-name>
    
       <connection-url>
       jdbc:mysql://{ipaddress}:{port}/{database_name}?characterEncoding=UTF-8
       </connection-url>
    
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    
    <user-name>{username}</user-name>
    
    <password>{password}</password>  
    
    <metadata>
    
       <type-mapping>mySQL</type-mapping>
    
    </metadata>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a web application with Grails, using the Acegi/Spring Security plugin. I want
I'm building a MVC web application (using the Spring MVC framework), and I'm a
I am building a web application with RESTful web services using Spring MVC 3.
I'm building a web application using Stripes and Spring. It needs to have a
I am building a web application using ASP.NET MVC that has two very distinct
I'm am building my asp.net web application using MVC (Preview 5), and am also
I am building an ASP.NET MVC web application using entity framework DbContext using the
I'm building a Web application with Java. Trying to integrate Spring Web MVC 3.0
I am building a Web Application using asp.net (C#). I come from windows forms
I'm building a web application using PHP5.3 and Zend Framework 1.9.4. i have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.