Announcement Announcement Module
Collapse
No announcement yet.
spring mvc response html with utf-8's problems. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring mvc response html with utf-8's problems.

    I need response html,encoding with utf-8. so i added the "produces = "text/html;charset=UTF-8" to @RequestMapping.but respose it's not correctly! Anyone can helps me?

    the code:
    Code:
    	@RequestMapping(value="banner.html",produces = "text/html;charset=UTF-8")
    	@ResponseBody
    	public String banner()
    	{
    		//this.template=new FreeMarkerTemplate(context);
    		//this.company=companyService.getCompany(1);
    		
    		Map<Object , Object> model = new HashMap<Object,Object>();
    		
    		model.put("logo", this.company.getCmpLogo());
    		model.put("banner1", this.company.getBanner1());
    		model.put("banner2", this.company.getBanner2());
    
    		return this.template.processTemplate(tpl_banner, model);
    	}
    PS:
    if i changed it to @RequestMapping(value="banner",produces = "text/plain;charset=UTF-8"),it's reponse correctly!
    but the result is plain text,i need html.

  • #2
    Look at the thread has the same problem with yours.

    Comment

    Working...
    X