• 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 Servlet

 
Ranch Hand
Posts: 99
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I want to start using JSF primefaces, im using NEtbeans 7.0+,
to use a FacesServlet in Netbeans is a normal Servlet? or where i should opne a JSF Servlet?

If I go to Java Server Faces folder to add a new File Type i have the following:
JSF Page
JSF Managed Bean
JSF Faces Configuration
...
...
but i dont see any JSF Servlet.

Should I open from JSP a normal Servlet?

Sorry for this silly question.

Thanks in advance.
-M
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF is a Model/View/Controller architecture and yes, there is a very definite reason why you must use the FacesServet - it's the master Controller for the JSF MVC system.

Technically, you could also use a subclass of FacesServlet, but in all the years I've worked with JSF I've never seen a need to do so. The stock FacesServlet works well enough.

JSF does not "own" the webapp. That makes it convenient, because you can migrate to JSF gradually and even run frameworks such as Struts side by side with JSF in the same webapp. However, any web pages defined in JSF View Definition Language (xhtml) and that you want to get JSF's benefits from (model/view automated data transfer, input validation and error reporting, action methods and such) must be handled via the FacesServlet.

There are really only 2 things you can do with the FacesServlet itself.

1. Code a URL pattern(s) so that JSF URK requests will be properly routed via the FacesServlet.

2. Set FacesServlet operating parameters such as the one that determines whether the user's state will be held on the server or passed back and forth in client requests.

Both of the above are defined in the web.xml and are basically "set-and-forget" items that you will almost never change.
 
Mauro Trevigno
Ranch Hand
Posts: 99
Tomcat Server Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim.

:)
 
It's never done THAT before. Explain it to me tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic