この質問が何度か聞かれたことは知っていますが、コードのどこが悪いのかわからないので、もう一度質問します-ごめんなさい:-)。
私は現在、GlassfishにデプロイされたJavaEE6フレームワークでJSF2.1に取り組んでいます。このエラーをスローするページには、ヘッダーとフッターを含むbaseTemplateがあります。次に、baseTemplateを継承するページがあります。基本的には次のとおりです。BaseTemplate:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<f:view>
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<link rel="shortcut icon" href="" />
<h:outputStylesheet library="css" name="site.css" target="head"></h:outputStylesheet>
<ui:insert name="head" />
</h:head>
<h:body>
<div id="wrapper" class="rounded-box">content...
ヘッダ
<?xml version='1.0' encoding='UTF-8' ?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<div class="header">
フッターには、プレーンなhtmlタグが含まれているだけです。
そして、ログインである実際のページ。
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
template="/shared/page/_twoColumn.xhtml">
<ui:define name="head"></ui:define>
<ui:define name="leftContent">
</ui:define>
<ui:define name="content">...........
何が問題なのですか?私はすでにxmlns:h="http://java.sun.com/jsf/html"名前空間を持っていることに注意してください。
ありがとう、
czetsuya