• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How to mapping request /faces/*?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"



 
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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/*?
 
Bin Smith
Ranch Hand
Posts: 514
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic