使用JSF创建AMP页面
您好,我正在尝试用JSF在我的站点上创建一个AMP页面,但我遇到了这个问题使用JSF创建AMP页面,jsf,jsf-2,amp-html,Jsf,Jsf 2,Amp Html,您好,我正在尝试用JSF在我的站点上创建一个AMP页面,但我遇到了这个问题 The mandatory attribute '⚡' is missing in tag 'html ⚡ for top-level html 在JSF中,我得到了这样的东西 <!DOCTYPE html> <html xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core"
The mandatory attribute '⚡' is missing in tag 'html ⚡ for top-level html
在JSF中,我得到了这样的东西
<!DOCTYPE html>
<html xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
>
我能做些什么?@Hackerman解决方案对我来说很有效,但我必须对其进行一些更改
<html amp
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" >
所以我把它改成这个
<html amp="amp"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" >
它似乎对我有用:)只需将
amp
添加到您的html
标记中,就像
那样,实际上很有效,但我必须对其进行一些更改。很高兴帮助@Victor
08:20:22,576 ERROR [io.undertow.request] (default task-9) UT005023: Exception handling request to /contiego-app/faces/public/pages/event/event-detail-amp.xhtml: javax.servlet.ServletException: Error Parsing /faces/public/pages/event/event-detail-amp.xhtml: Error Traced[line: 4] Attribute name "amp" associated with an element type "html" must be followed by the ' = ' character.
<html amp="amp"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" >