I am learning JSF.
I created a sample site using JSF template mechanism. My page structures are as below.

/index.xhtml
/register.xhtml
/templates/masterTemplate.xhtml

the files both index and register are using masterTemplate.xhtml. my project url is

http://localhost/books/

When I type http://localhost/books/ in the address bar of the browser I am getting the index.xhtml file correctly. I have a link to register.xhtml from the index page. When I click the linke browser goes to

http://localhost/books/register.xhtml

the problem what I am getting is.. The register.xhtml is displayed as a raw xml file. It is not getting templated. But if I change the url to look something like this

http://localhost/books/faces/register.xhtml

then the register.xhtml file works fine with template.

What I am doing wrong here??