How to use @RequestParam(value=“foo”) Map<MyEnum, String> in Spring Controller?
问题 I want to use some Map<MyEnum, String> as @RequestParam in my Spring Controller. For now I did the following: public enum MyEnum { TESTA("TESTA"), TESTB("TESTB"); String tag; // constructor MyEnum(String tag) and toString() method omitted } @RequestMapping(value = "", method = RequestMethod.POST) public void x(@RequestParam Map<MyEnum, String> test) { System.out.println(test); if(test != null) { System.out.println(test.size()); for(Entry<MyEnum, String> e : test.entrySet()) { System.out