java - Chinese characters not being rendered on JSP - Stack Overflow

I have a jsp say hello.jsp. Now there are 2 use casesthe request is redirected to hello.jsp through mai

I have a jsp say hello.jsp. Now there are 2 use cases

  1. the request is redirected to hello.jsp through mainserverlet and in this case, it renders the "editable" text in chinese properly.

  2. The second case is when i change the drop down menu on hello.jsp, it "resubmits" the request to itself, instead of mainservlet and in this case the text in chinese is not being displayed properly.

    • The charset=UTF-8 encoding has been set in HTML tag of the jsp.
    • I have tried to see how form is being submitted through javascript and the chinese text remains the same just before "submit". I don't know what happens that it is not being rendered after this.

Any pointers or suggestions?

I have a jsp say hello.jsp. Now there are 2 use cases

  1. the request is redirected to hello.jsp through mainserverlet and in this case, it renders the "editable" text in chinese properly.

  2. The second case is when i change the drop down menu on hello.jsp, it "resubmits" the request to itself, instead of mainservlet and in this case the text in chinese is not being displayed properly.

    • The charset=UTF-8 encoding has been set in HTML tag of the jsp.
    • I have tried to see how form is being submitted through javascript and the chinese text remains the same just before "submit". I don't know what happens that it is not being rendered after this.

Any pointers or suggestions?

Share edited May 20, 2012 at 20:58 Makoto 107k27 gold badges198 silver badges236 bronze badges asked Jun 22, 2011 at 19:47 x.509x.509 2,23510 gold badges45 silver badges60 bronze badges 1
  • Dude is your issue fixed? – Vishwaram Sankaran Commented Dec 1, 2017 at 7:17
Add a ment  | 

1 Answer 1

Reset to default 5

Have you tried page tag?

Sample:

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

Obs: You need to put this on top of every page you use.

PS: If you are thinking you can add above line in your header.jsp file and then include header file in your required file like this:

<jsp:include page="/resources/header.jsp" /> 

It won't work unless you add that line in every page.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744915694a4600819.html

相关推荐

  • java - Chinese characters not being rendered on JSP - Stack Overflow

    I have a jsp say hello.jsp. Now there are 2 use casesthe request is redirected to hello.jsp through mai

    1天前
    60

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信