2017-08-15 Notes on International Learning of SpringMVC Framework Project

International development plan of springMVC

1. Project branch, develop internationalization on the branch

2. International classification: static pages (html+js+pictures), dynamic data (drop-down boxes, multi-select boxes, tree data, etc.), background messages

3. The naming rules are mainly divided into four categories, 1) front-end html elements, 2) front-end js, 3) front-end public elements, 4) back-end elements

4. Description of specific rules for naming definition: 1) html. directory name. file name. html element, 2) js. directory name. file name. method name. value1 (multiple serial numbers such as value2, value3), 3) sys .Element (js, button, head). Attribute field, 4) class name. method name. value1 (multiple sequence numbers such as value2, value3)

5. Easyui language package judgment, to switch Chinese to import the easyui-lang-zh_CN.js file

6. For page tag reference, the velocity template only needs to use its own #springMessage ("property file key"), and the jsp page should introduce the <%@ taglib prefix="spring" uri="/WEB-INF/spring.tld"%> file , the page can be referenced with <spring:message code="title" />

7. The background message refers to the internationalization property file, and a method is abstracted in the BaseController. The code is as follows:

/**

* Get the internationalization properties file value

* @param code

* @return

*/

public String getMessagesValue(String code){

RequestContext requestContext = new RequestContext(this.getRequest());

return requestContext.getMessage(code);

}

Called by subclasses.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326171888&siteId=291194637