| Author |
How to mapping request /faces/*?
|
Ismael Rodriguez
Greenhorn
Joined: Dec 26, 2012
Posts: 6
|
|
Hi,
I've problem mapping request with /faces/*
My web.xml
Hello.xhtml
welcome.xhtml
The project
when I start the project, it works fine, but when I push the link, the request is not found, why?. If welcome.xhtml file is in the same directory as hello.xhtml, also works correctly if the address change to "welcome"
|
 |
Volodymyr Levytskyi
Ranch Hand
Joined: Mar 29, 2012
Posts: 187
|
|
Hello!
1. Two mappings for one FacesServlet is not good I have read.
2. You don't need folder faces to map FacesServlet to /faces/*. You only need to add this /faces/* in url and FacesServlet will process such urls and directs you to
path which is defined by removing word /faces/*.
3. You can't access page put into WEB-INF folder from browser. There you can put templates, composite components, configuration files.
I would recommend to pass at first good tutorial on jsf like this http://www.coreservlets.com/JSF-Tutorial/jsf2/ !!!
|
 |
Ismael Rodriguez
Greenhorn
Joined: Dec 26, 2012
Posts: 6
|
|
Volodymyr Levytskyi wrote:Hello!
2. You don't need folder faces to map FacesServlet to /faces/*. You only need to add this /faces/* in url and FacesServlet will process such urls and directs you to
path which is defined by removing word /faces/*.
OK, Thank.
If i want to have a directory structure with several directories with xhtml file, how i do reference them in index.xhtml ?
For examlple
Webcontent
|---login
|--login.xhtml
|---|ex
|--ex.xhtml
|--index.xhtml
and the mapping in servlet is /faces/*?
|
 |
Volodymyr Levytskyi
Ranch Hand
Joined: Mar 29, 2012
Posts: 187
|
|
Hello!
http://localhost:8080/projectName/faces/folder1/folder2/folder3/mypage.xhtml
Wherever in your webcontent you have some page you can reference mypage.xhtml by /folder1/folder2/folder3/mypage3.xhtml.
You simply take path to page in webcontent
|
 |
 |
|
|
subject: How to mapping request /faces/*?
|
|
|