2013-05-05 136 views
-1

超鏈接沒有出現在網頁上顯示XHTML頁面上,我部署在GlassFish server.Below是image.Under產品部分都是超鏈接超鏈接不顯示

enter image description here

下面
是代碼

<?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> 


請任何人都可以讓我知道什麼是落後

的原因

更新:

這不僅所有頁面都沒有得到呈現(僅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> 
+0

您是否在瀏覽器中查看HTML源文本?如果您沒有正確綁定JSF servlet,則「h:outputLink」將出現在HTML中。 – 2013-05-05 20:48:40

+0

@JoopEggen yes h:outputLink出現在視圖源代碼中,它沒有被渲染成html代碼 – developer 2013-05-05 20:54:21

+0

@JoopEggen請你幫忙這個 – developer 2013-05-05 21:03:12

回答

1

添加servlet映射爲* .xhtml後其做工精細

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