Results 1 to 2 of 2

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

  1. #1
    Join Date
    Dec 2012
    Posts
    1

    Angry 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. #2
    Join Date
    Sep 2011
    Posts
    25

    Default

    Look at the thread has the same problem with yours.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •