I18nController.java 610 Bytes
package com.bsth.controller;

import com.bsth.util.I18n;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("i18n")
public class I18nController {
	
	@RequestMapping(value = "/{basename}", method = RequestMethod.GET)
	public Map<String, String> basename(@PathVariable("basename") String basename) {
		return I18n.getInstance().getAllMessage(basename);
	}
}