h:outputScript标签和charset属性,是可能吗? [英] h:outputScript tag and charset attribute, is it possible?
问题描述
首先,我想说,我已经在
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屋!