印地语内容没有在jsp中显示?

时间:2014-07-10 11:50:06

标签: jsp servlets

我在servlet中使用以下代码

    VelocityEngine ve = new VelocityEngine();
    ve.init(velocityProperties);
    Template t = ve.getTemplate( templateName );
    VelocityContext context = new VelocityContext();
    context.put("fullname", fullname);
    context.put("fathername", fathername);    

    StringWriter writer = new StringWriter();
    t.merge(context, writer);

    String fetchedContents = writer.toString();

通过此代码我获取速度模板的内容。并用会话设置它。

session.setAttribute("fetchedContents", fetchedContents);

现在在jsp页面上我通过以下代码

收到fetchedContents的值
String fetchedContents = (String) session.getAttribute("fetchedContents");

现在我想在jsp页面上打印fetchedContents的值

<%=fetchedContents%>

但它以下列格式显示 -

à¤à¥ लिठà¤à¤¯ à¤à¤° à¤à¤§à¤¿à¤à¤¾à¤°à¤¿à¤¯à¥à¤ à¤à¥ 

我在jsp页面上使用UTF-8编码,并尝试更改其他编码,但没有找到任何解决方案。请给我解决方案?

0 个答案:

没有答案
相关问题