File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1515 <bean class =" org.springframework.web.servlet.view.InternalResourceViewResolver"
1616 p : prefix =" /WEB-INF/jsp/"
1717 p : suffix =" .jsp" />
18+
19+ <!--
20+ <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"
21+ p:cacheSeconds="60"
22+ p:defaultEncoding="UTF-8">
23+ <property name="basenames">
24+ <list>
25+ <value>messages/app</value>
26+ </list>
27+ </property>
28+ </bean>
29+ -->
30+ <bean id =" messageSource" class =" org.springframework.context.support.ReloadableResourceBundleMessageSource"
31+ p : cacheSeconds =" 5"
32+ p : defaultEncoding =" UTF-8" >
33+ <property name =" basenames" value =" file:///#{systemEnvironment['TOPJAVA_ROOT']}/config/messages/app" />
34+ <property name =" fallbackToSystemLocale" value =" false" />
35+ </bean >
1836</beans >
Original file line number Diff line number Diff line change 11<%@page contentType =" text/html" pageEncoding =" UTF-8" %>
2- <%@ taglib prefix =" fmt " uri =" http://java.sun.com/jsp/jstl/fmt " %>
2+ <%@ taglib prefix =" spring " uri =" http://www.springframework.org/tags " %>
33
4- <fmt:setBundle basename =" messages.app" />
54<header >
6- <a href =" meals" ><fmt :message key =" app.title" /></a > | <a href =" users" ><fmt :message key =" user.title" /></a > | <a href =" ${ pageContext. request. contextPath } " ><fmt :message key =" app.home" /></a >
5+ <a href =" meals" ><spring :message code =" app.title" /></a > | <a href =" users" ><spring :message code =" user.title" /></a > | <a href =" ${ pageContext. request. contextPath } " ><spring :message code =" app.home" /></a >
76</header >
Original file line number Diff line number Diff line change 11<%@page contentType =" text/html" pageEncoding =" UTF-8" %>
2- <%@ taglib prefix =" fmt" uri =" http://java.sun.com/jsp/jstl/fmt" %>
3- <fmt:setBundle basename =" messages.app" />
2+ <%@ taglib prefix =" spring" uri =" http://www.springframework.org/tags" %>
43<hr >
5- <footer ><fmt :message key =" app.footer" /></footer >
4+ <footer ><spring :message code =" app.footer" /></footer >
Original file line number Diff line number Diff line change 11<%@page contentType =" text/html" pageEncoding =" UTF-8" %>
2- <%@ taglib prefix =" fmt " uri =" http://java.sun.com/jsp/jstl/fmt " %>
2+ <%@ taglib prefix =" spring " uri =" http://www.springframework.org/tags " %>
33<%@ taglib prefix =" c" uri =" http://java.sun.com/jstl/core" %>
4- <fmt:setBundle basename =" messages.app" />
54
65<head >
76 <meta http-equiv =" Content-Type" content =" text/html; charset=UTF-8" >
8- <title ><fmt :message key =" app.title" /></title >
7+ <title ><spring :message code =" app.title" /></title >
98 <link rel =" stylesheet" href =" resources/css/style.css" >
109</head >
Original file line number Diff line number Diff line change 11<%@ page contentType =" text/html;charset=UTF-8" language =" java" %>
22<%@ taglib prefix =" c" uri =" http://java.sun.com/jsp/jstl/core" %>
3- <%@ taglib prefix =" fmt" uri =" http://java.sun.com/jsp/jstl/fmt" %>
4-
5- <fmt:setBundle basename =" messages.app" />
3+ <%@ taglib prefix =" spring" uri =" http://www.springframework.org/tags" %>
64
75<html >
86<jsp:include page =" fragments/headTag.jsp" />
119<br >
1210<section >
1311 <form method =" post" action =" users" >
14- <fmt :message key =" app.login" />: <select name =" userId" >
12+ <spring :message code =" app.login" />: <select name =" userId" >
1513 <option value =" 100000" selected >User</option >
1614 <option value =" 100001" >Admin</option >
1715 </select >
18- <button type =" submit" ><fmt :message key =" common.select" /></button >
16+ <button type =" submit" ><spring :message code =" common.select" /></button >
1917 </form >
2018</section >
2119<jsp:include page =" fragments/footer.jsp" />
Original file line number Diff line number Diff line change 11<%@ page contentType =" text/html;charset=UTF-8" language =" java" %>
22<%@ taglib prefix =" c" uri =" http://java.sun.com/jsp/jstl/core" %>
33<%@ taglib prefix =" fmt" uri =" http://java.sun.com/jsp/jstl/fmt" %>
4-
5- <fmt:setBundle basename =" messages.app" />
4+ <%@ taglib prefix =" spring" uri =" http://www.springframework.org/tags" %>
65
76<html >
87<jsp:include page =" fragments/headTag.jsp" />
98<body >
109<jsp:include page =" fragments/bodyHeader.jsp" />
1110
1211<section >
13- <h3 ><fmt :message key =" user.title" /></h3 >
12+ <h3 ><spring :message code =" user.title" /></h3 >
1413
1514 <table border =" 1" cellpadding =" 8" cellspacing =" 0" >
1615 <thead >
1716 <tr >
18- <th ><fmt :message key =" user.name" /></th >
19- <th ><fmt :message key =" user.email" /></th >
20- <th ><fmt :message key =" user.roles" /></th >
21- <th ><fmt :message key =" user.active" /></th >
22- <th ><fmt :message key =" user.registered" /></th >
17+ <th ><spring :message code =" user.name" /></th >
18+ <th ><spring :message code =" user.email" /></th >
19+ <th ><spring :message code =" user.roles" /></th >
20+ <th ><spring :message code =" user.active" /></th >
21+ <th ><spring :message code =" user.registered" /></th >
2322 </tr >
2423 </thead >
2524 <c:forEach items =" ${ users } " var =" user" >
You can’t perform that action at this time.
0 commit comments