• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF Url Mapping (Newbie)

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am still a newbie to JSF. I used IBM RAD to create a sample JSF application for me. It is basically a page that fetches some data from the db and displays it. What RAD generated for me was a .xhtml file with a datatable to show the contents of the data, a faces.config xml file and web.xml. The web.xml of course had the following...



And faces.config.xml had following...


AdviceDetailManager is like a JPA DAO which has the JPA code to fetch the data. And my xhtml page is "advice_inquiry.xhtml". My question is when I call the URL "http://localhost:9080/AdvisingWeb/advice_inquiry.faces", how does Faces Servlet know to find AdviceDetailManager to get it the data it needs. The URL mapping in JSF does not seem so straighforward as Struts.

Thanks for any help.

 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When in you page you call a method like: adviceDetailManager.yourMethod the JSF will know which class to find this method.

I believe it is easier than Struts.

You just need to map the class. [=
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is why we are so anti-IDE on forums like these. You've got extremely powerful tools generating complex things, but you don't actually know how the things work.

When people do that to build real-world professional applications, the results are usually pretty horrible. Doubly-so when some "expert" is in charge of the staff, dictating silly standards based on imperfect knowledge that is often outdated.

I strongly recommend getting a good book on JSF and reading it to get familiar with the basic concepts. Once you've done that, the actions of the IDE will make more sense and you'll know how and why things are the way they are (even without the IDE).

This is standard advice we give everyone for everything, but especially meaningful for your question, since the URL mapping and dispatching in JSF is rather different than it is for most webapp frameworks.
reply
    Bookmark Topic Watch Topic
  • New Topic