0

I use this html code to navigate to JSF pages:

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

This JSF code works fine

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

But this is not working when I have pages in different folders.

How I can navigate between pages in different folders?

I get this result when I click on the link:

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

I'm navigated here:

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

But it should be here

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

Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
  • But what **does** happen? ww3? What is generated client side? 'Not working' is not as a developer should report something – Kukeltje Mar 31 '16 at 20:27

1 Answers1

1

add your contextpath before page name

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

or you can navigate from backing bean using external context

 FacesContext.getCurrentInstance().getExternalContext().redirect(url)
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
Dom
  • 9
  • 2