1.在创建jsp页面时,使用<html:html lang="true"> ;报错怎么办?
将<html:html lang="true">改为<html:html locale="true">或删除
2.<html:html lang="true">或者<html:html locale="true">的功能
<html>标签有两个属性:locale和xhtml,两者都不是必需的。
通过代码来介绍:
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html locale="true">
<head>
<title>Welcome</title>
</head>
<body>Hello World!</body>
</html:html>
注意,我们没有用标准的<html>元素,而是用了<html:html>标签。其中第一个html指的是前缀,第二个是<html>标签本身。而且我们也用了locale属性。JSP页面将显示如下:<html lang="en">
<head>
<title>Welcome</title>
</head>
<body>Hello World!</body>
</html>
注意,<html:html locale=“true”>中的locale属性在生成的HTML页面中被转换成了lang=“en”。
生成的结果取决于Struts应用程序所 位于的服务器的locale(中国的服务器解析成<html lang="zh-CN">)。
如果你将应用程序部署到一个不同locale的服务器,你不需要改变代码。Locale会自动调整
新的版本将locale改为lang