h:outputScript标签和charset属性,是可能吗? [英] h:outputScript tag and charset attribute, is it possible?

查看:451
本文介绍了h:outputScript标签和charset属性,是可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我想说,我已经在

First of all, I'd like to say that I've already posted this question in another forum, but as I haven't had any answers until now, and this is an important issue to me, I'm asking it here too.

The HTML <script> tag has the charset attribute, but I can't specify this attribute using the <h:outputScript> tag. I tried to use the preRenderComponent system event and put the attribute manually but it had no effect; the attribute wasn't rendered. Is there a way to specify the charset attribute, even programmatically?

解决方案

Just use UTF-8 all the time. Facelets defaults to UTF-8 already. You should take care that you configure your editor/IDE to save all textbased resources as UTF-8. In Eclipse, you need to go to Window » Preferences and enter filter text encoding. In all of the filtered preferences (Workspace, JSP files, etcetera) you can select the desired encoding from a dropdown.

You might want to make minor edits (add/remove space or something) on existing files to force Eclipse to save them as UTF-8 again.

See also:

这篇关于h:outputScript标签和charset属性,是可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆