• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

HTML/JSP to start JSF page

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not the first time when I see a JSF example starting with something like this:

Is it necessary? Do you use it in real life or only with examples? What's the point? The same applies to JSF 2.0?
 
Ranch Hand
Posts: 220
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because the JSF techology build on the J2EE technology and the JSF framework must be started by using URL such as Index.faces.



Users can call Index.html like the code you mentioned and then the FacesServlet will be initialized by mapping Index.faces url to FacesServlet in your web.xml file.
But if you dont want to use refresh the function of HTML code, you can change your FacesServletMapping.

example



By doing that you can for example create a .jsp page under the file structure (/appName/jsf/pages/index.jsp). However by doing that users must know the index page URL
 
Krystian Gor
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I got it,
but what's the difference between redirecting from index.html to index.faces and running directly ".../appname/index.faces"? Is it exactly the same?
 
Tuna Töre
Ranch Hand
Posts: 220
Eclipse IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, both of them do the same thing.
Initializing the JavaServer Faces framework's FacesContext

Tuna TÖRE
 
Krystian Gor
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic