2016-03-31 68 views
0

我用這個HTML代碼導航到JSF頁面的網頁:導航到不同的文件夾

<a href="NewCustomer.xhtml">New Customer</a> 

這JSF代碼工作正常

<h:outputLink value="NewCustomer.xhtml" > 
    New Customer 
</h:outputLink> 

但是這是不工作的時候我已經在不同的頁面文件夾。

如何在不同文件夾中的頁面之間導航?

我得到這樣的結果,當我點擊鏈接:

http://localhost:8085/Crm_site/Dashboard.xhtml

我在這裏導航:

http://localhost:8085/customers/Customers.xhtml

但它應該在這裏

http://localhost:8085/Crm_site/customers/Customers.xhtml

+0

瀏覽但什麼** **不會發生? WW3?生成的客戶端是什麼? '不工作'不是開發者應該報告的東西 – Kukeltje

+0

我添加了示例 –

回答

1

前網頁名稱

#{request.contextPath}/customers/Customers.xhtml 

添加您的contextPath或者你可以從後臺bean使用外部環境

FacesContext.getCurrentInstance().getExternalContext().redirect(url)