我正在做我的课程期末作业,我在 JSF 和 HTML5 方面遇到了一些问题。在问这个之前,我读了这个和这个答案。
在我的项目设置(属性 - >项目方面)我有:
- 爪哇:1.6
- 动态 Web 项目:2.5
- JSF:2.0(莫哈拉 2.0.3)
我创建了单独的 HTML5 文件,现在我想将我的 Java 软件与我的前端代码合并。但是我遇到了问题,JSF 不呈现 .html 文件。
这是我的原始 HTML:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE HTML>
<html xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="Fernando Paladin">
<title>Locus - Disciplinas </title>
<link href="../../css/bootstrap.css" rel="stylesheet">
<link href="../../css/custom.css" rel="stylesheet">
</h:head>
<h:body>
<div class="container">
<div class="row">
<div class="col-lg-8 center">
<h:form role="form">
<div class="form-group">
<div class="col-md-10">
<h:inputText id="disciplina" class="form-control" value="#{disciplinaMBean.nome}" />
<!-- <input type="text" size="20" class="form-control" id="disciplina" placeholder="Pesquise ou crie uma nova disciplina"
required> -->
</div>
<div class="col-md-2">
<h:commandButton class="btn btn-md btn-success" action="#{disciplinaMBean.cadastrar}">
Adicionar
</h:commandButton>
<!-- <a type="button" href="#" class="btn btn-md btn-success">Adicionar</a> -->
</div>
</div>
<div class="col-md-10">
<div class="form-group">
<br/>
<h:dataTable value="#{disciplinaMBean.listaDisciplinas}" var="disciplina">
<h:column>
<f:facet name="header">Nome</f:facet>
<h:outputText value="#{disciplinaMBean.nome}" />
</h:column>
</h:dataTable>
<!-- <textarea class="form-control" placeholder="Aqui vão ser carregadas as disciplinas" rows="5"></textarea> -->
</div>
</div>
</h:form>
</div>
</div>
</div>
<!-- JavaScripts e Complementos -->
<script src="../../js/jquery.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/bootstrap-progressbar.min.js"></script>
</h:body>
</html>
这就是渲染的内容:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE HTML>
<html xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="author" content="Fernando Paladin">
<title>Locus - Disciplinas </title>
<link href="../../css/bootstrap.css" rel="stylesheet">
<link href="../../css/custom.css" rel="stylesheet">
</h:head>
<h:body>
<div class="container">
<div class="row">
<div class="col-lg-8 center">
<h:form role="form">
<div class="form-group">
<div class="col-md-10">
<h:inputText id="disciplina" class="form-control" value="#{disciplinaMBean.nome}" />
<!-- <input type="text" size="20" class="form-control" id="disciplina" placeholder="Pesquise ou crie uma nova disciplina"
required> -->
</div>
<div class="col-md-2">
<h:commandButton class="btn btn-md btn-success" action="#{disciplinaMBean.cadastrar}">
Adicionar
</h:commandButton>
<!-- <a type="button" href="#" class="btn btn-md btn-success">Adicionar</a> -->
</div>
</div>
<div class="col-md-10">
<div class="form-group">
<br/>
<h:dataTable value="#{disciplinaMBean.listaDisciplinas}" var="disciplina">
<h:column>
<f:facet name="header">Nome</f:facet>
<h:outputText value="#{disciplinaMBean.nome}" />
</h:column>
</h:dataTable>
<!-- <textarea class="form-control" placeholder="Aqui vão ser carregadas as disciplinas" rows="5"></textarea> -->
</div>
</div>
</h:form>
</div>
</div>
</div>
<!-- JavaScripts e Complementos -->
<script src="../../js/jquery.js"></script>
<script src="../../js/bootstrap.min.js"></script>
<script src="../../js/bootstrap-progressbar.min.js"></script>
</h:body>
如您所见,我的原始文件是渲染文件。所以,我不能点击任何字段,不能在输入中输入文本,最终,我什么也做不了。
这是如何引起的,我该如何解决?