Liferay 乱码

环境:
Liferay Portal 5.2.3 CE (Bundle with tomcat 6)

开发方式:
plugin sdk


1.Jsp页面乱码
参照普通的Jsp乱码解决方案
比如在Jsp页面开始加入

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



2.Portlet信息乱码(标题title portlet-info)
参照sample-localized-portlet-5.2.0.1.war

在Portlet.xml中加入

<resource-bundle>你的资源文件</resource-bundle>


eg.
资源文件在info/heylib/liferay/resources/Resource.properties

<resource-bundle>info.heylib.liferay.resources.Resource</resource-bundle>


如果你有其他i18n支持

<supported-locale>fr</supported-locale>
<supported-locale>zh</supported-locale>
<resource-bundle>info.heylib.liferay.resources.Resource</resource-bundle>

当然Resource_zh.properties , Resource_fr.properties 应该是存在的,而且是和Resource.properties在同一路径下

注意一点:
Resource.properties文件不管你是UTF-8还是ISO,GBK的 记得native2ascii
否则仍将出现乱码,eclipse下推荐使用PropertiesEditor插件

keywords应该足够了,其他不详google一下,应该没问题了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值