• Post Reply Bookmark Topic Watch Topic
  • New Topic

EL's encode

 
Kidd He
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got a parameter named "name" through post method.But the "name" is a Chinese word in GBK.When I use ${param.name},it prints "???".I already have the <%@ page pageEncoding="GBK"%>.
I can change the encoding through the servlet.But how can I do the same thing with the EL in JSP?
How can I make the jsp print the correct word in Chinese?
Thanks!
 
Stefan Evans
Bartender
Posts: 1822
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a useful article on this problem: here

I think you also need to set the content type and charset for your page.
Page Encoding is the encoding your JSP will be downloaded as (ie what it uses for reading the JSP).
The content type/charset is for how it will submit/upload data.

<%@page pageEncoding="GBK" contentType="text/html; charset=GBK"%>
 
Kidd He
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks~~!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!