2010-09-06 62 views
1

我试图在JSF页面中插入雅虎天气小部件。雅虎生成的代码如下:包含查询字符串的iframe在JSF中导致问题

<!-- Yahoo! Weather Badge --><iframe allowtransparency="true" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://weather.yahoo.com/badge/?id=12753136&u=c&t=trans&l=vertical" height="255px" width="186px"></iframe><!-- Yahoo! Weather Badge --> 

请注意,iframe src包含查询字符串。当我尝试运行它,我得到这个错误:

Error Traced[line: 42] The reference to entity "u" must end with the ';' delimiter. 

为什么试图解释查询字符串的字符作为一个实体?我如何解决这个问题?

回答

3

你显然使用XML/XHTML。您需要用&amp;替换所有“普通香草”&号&