私は eclipse juno を使用しており、Web サイトを構築しようとしています。ユーザー インターフェイスを構築しており、JSF を使用したいと考えています。次のコードが実行され、ファイルを実行すると、情報が画面に正しく表示されます。
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="Stylesheets/flashcard.css" />
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form>
<h:commandButton value="Click"></h:commandButton>
</h:form>
</f:view>
ただし、このようにコードを記述する方が良い方法であると読みました。このコードは、空白のページを表示するだけです。
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="Stylesheets/flashcard.css" />
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form>
<h:commandButton value="Click"></h:commandButton>
</h:form>
</f:view>
</body>
</html>
違いは微妙ですが、2 番目のファイルでは jsp <%@ タグを使用しません。2 番目のファイルを作成するときに、JSF xhtml などを選択しました。問題が何であるかを知っている人はいますか?