siye@r480:~/svlution/workspace/springmvc4322$ tree src/
src/
├── main
│ ├── java
│ │ ├── log4j.properties
│ │ └── ocn
│ │ └── site
│ │ └── springmvc
│ │ ├── controller
│ │ │ └── Manicontroller.java
│ │ ├── setup
│ │ │ ├── Appconfig.java
│ │ │ └── Webxmlconfig.java
│ │ └── utils
│ │ └── ConstraintsUtils.java
│ ├── resources
│ │ └── i18n
│ │ ├── message_en_US.properties
│ │ └── message_zh_CN.properties
│ └── webapp
│ ├── index.jsp
│ └── WEB-INF
│ ├── register.jsp
│ └── web.xml
└── test
├── java
└── resources
15 directories, 10 files
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.3.22.RELEASE</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
package ocn.site.springmvc.controller;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.servlet.support.RequestContext;
@Controller
public class Manicontroller {
private final Logger logger = Logger.getLogger(this.getClass());
@GetMapping("/test/{var}")
public String handler(HttpServletRequest request, @RequestHeader("accept-language") String value,
@PathVariable("var"