Java 超链接未显示在xhtml页面上

Java 超链接未显示在xhtml页面上,java,jsf,glassfish-3,Java,Jsf,Glassfish 3,超链接没有显示在页面上,我部署在glassfish服务器上。下图。在“产品”部分下都是超链接 下面是代码 <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="h

超链接没有显示在页面上,我部署在glassfish服务器上。下图。在“产品”部分下都是超链接


下面是代码

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!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:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
<head>

<title>eBusiness</title>
</head>
<body>
<table>
<tr>
<td>
<h1 style="background-color:#4863A0;color:white;">eBusiness: Product, Customer, and Order Management</h1>
</td>
</tr>
</table>
<f:view>
<h:form>
<table>
<tr><td><h2>PRODUCTS</h2>
</td>
</tr>
</table>
<table>
<tr>
<td>
<h:outputLink  value="createbook.xhtml">Create a new Book</h:outputLink>|</td><td><h:outputLink  value="viewbooklist.xhtml">The Stock of Books</h:outputLink>|</td><td><h:outputLink  value="searchbooks.xhtml">Search for Books</h:outputLink></td>
</tr>
<tr>
<td>
<h:outputLink  value="createcds.xhtml">Create a new CDs</h:outputLink>|</td><td><h:outputLink  value="viewcdslist.xhtml">The Stock of CDs</h:outputLink>|</td><td><h:outputLink  value="searchcds.xhtml">Search for CDs</h:outputLink></td>
</tr>
</table>
<table>
<tr><td><h2>CUSTOMERS</h2>
</td>
</tr>
</table>
<table>
<tr>
<td>
<h:outputLink  value="createcustomer.xhtml">Create a new Customer</h:outputLink>|</td><td><h:outputLink  value="viewcustomerlist.xhtml">List of Customers</h:outputLink>|</td><td><h:outputLink  value="searchcustomer.xhtml">Search for a Customers</h:outputLink></td>
</tr>
</table>
<table>
<tr><td><h2>ORDERS</h2>
</td>
</tr>
</table>
<table>
<tr>
<td>
<h:outputLink  value="createorders.xhtml">Create a new Order</h:outputLink>|</td><td><h:outputLink  value="vieworderslist.xhtml">List of Orders</h:outputLink>|</td><td><h:outputLink  value="searchorders.xhtml">Search for an Orders</h:outputLink></td>
</tr>
</table>
</h:form>
</f:view>
</body>
</html>

电子商务
电子商务:产品、客户和订单管理
产品
创建新书|图书库存|搜索图书
创建新CD | CD库存|搜索CD
客户
创建新客户|客户列表|搜索客户
命令
创建新订单|订单列表|搜索订单

请任何人告诉我背后的原因是什么

更新:

不仅如此,所有页面都不会呈现(仅显示html内容)

编辑

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>RetailProducts</display-name>
  <welcome-file-list>
    <welcome-file>createcustomer.xhtml</welcome-file><!-- eBusiness.xhtml</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file> -->
  </welcome-file-list>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
  <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
  </context-param>
  <context-param>
    <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
  </context-param>
  <context-param>
    <description>
    This parameter tells MyFaces if javascript code should be allowed in
    the rendered HTML output.
    If javascript is allowed, command_link anchors will have javascript code
    that submits the corresponding form.
    If javascript is not allowed, the state saving info and nested parameters
    will be added as url parameters.
    Default is 'true'</description>
    <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <description>
    If true, rendered HTML code will be formatted, so that it is 'human-readable'
    i.e. additional line separators and whitespace will be written, that do not
    influence the HTML code.
    Default is 'true'</description>
    <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
    <param-value>false</param-value>
  </context-param>
  <context-param>
    <description>
    If true, a javascript function will be rendered that is able to restore the
    former vertical scroll on every request. Convenient feature if you have pages
    with long lists and you do not want the browser page to always jump to the top
    if you trigger a link or button action that stays on the same page.
    Default is 'false'
</description>
    <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
    <param-value>true</param-value>
  </context-param>
<!--   <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  </listener> -->
<!--     <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
  </listener> -->
</web-app>

零售产品
createcustomer.xhtml
Facesservlet
javax.faces.webapp.FacesServlet
1.
Facesservlet
/面孔/*
javax.servlet.jsp.jstl.fmt.localizationContext
资源.应用
状态保存方法:“客户端”或“服务器”(=默认值)。参见JSF规范2.5.2
javax.faces.STATE_保存方法
客户
此参数告诉MyFaces是否应允许使用javascript代码
呈现的HTML输出。
如果允许使用javascript,则命令链接锚定将具有javascript代码
提交相应的表格。
如果不允许使用javascript,则保存信息和嵌套参数的状态
将作为url参数添加。
默认值为“true”
org.apache.myfaces.ALLOW_JAVASCRIPT
真的
如果为true,则将格式化呈现的HTML代码,使其“可读”
i、 e.将写入额外的行分隔符和空格,但不会
影响HTML代码。
默认值为“true”
org.apache.myfaces.PRETTY_HTML
真的
org.apache.myfaces.DETECT\u JAVASCRIPT
假的
如果为true,则将呈现一个能够恢复
前垂直滚动每个请求。方便的功能,如果你有网页
对于长列表,您不希望浏览器页面总是跳转到顶部
如果您触发的链接或按钮操作保持在同一页面上。
默认值为“false”
org.apache.myfaces.AUTO_滚动
真的

将servlet映射添加为*.xhtml后,其工作正常

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>

Facesservlet
*.xhtml

您是否在浏览器中查找HTML源文本?如果没有正确绑定JSF servlet,
h:outputLink
将出现在HTML中。@JoopEggen是的,h:outputLink出现在视图源中,它没有呈现为HTMLcode@JoopEggen请帮个忙您是否将
FacesServlet
映射到
*.xhtml
?你能发布web.xml吗?另外,您所说的“仅显示HTML内容”是什么意思?@JoopEggen我在上面发布了web.xml