internationalization i18n

 i18n mean i to n has 18 number character

Use:

Config messageSource in file config


 

1) Use jstl 

Pom: 

<dependency>

            <groupId>javax.servlet</groupId>

            <artifactId>jstl</artifactId>

</dependency>

 File.jsp add:

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

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%

<fmt:message key="message.password" var="noPass" />

<fmt:message key="message.username" var="noUser" />

 <h1>${noUser} & ${noPass}</h1>

2) Use spring tag

Add file jsp 

<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<h2> 

<spring:message code="message.tittle">

</spring:message>

 </h2>


0 comments :

Post a Comment

Cancel Reply

About Me

My photo
Tân An, Long An, Vietnam
Hello everyone, I love programming, I love making friends with people all over the world.