About the problem of garbled code in the background

problem description


(Spring)""

:
"{}"
name

related codes

/ / Please paste the code text below (do not replace the code with pictures)

@RequestMapping(value="/spittles/{name}")
public String showRegister(
        @PathVariable("name") String name,
        Model model
){
    try{
        Spittle spittle = this.spittleRepository.findSpittlesByName(name);
        System.out.println(name);
        System.out.println(spittle.getName()+ "  " + spittle.getMessage() + "  " + spittle.getTime());
        model.addAttribute(spittle);
    }catch(Exception e ){
        e.printStackTrace();
    }

    return "profile";
}

what result do you expect? What is the error message actually seen?

how to pass parameters in the above way, there is no garbled problem!?


configure org.springframework.web.filter.CharacterEncodingFilter in web.xml


tomcat container sets URIEncoding= "UTF-8" parameter

Menu