*
The moose likes JSF and the fly likes invoking face servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "invoking face servlet" Watch "invoking face servlet" New topic
Author

invoking face servlet

indra sen
Greenhorn

Joined: Jun 08, 2007
Posts: 27
We have existing application.Which has servlet like loginServlet.
now we want to incorporate JSF in our application.
How we can call Faces Servlet from LoginServlet.

web.xml file
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>login.LoginServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

I have tried
request.getRequestDispatcher("Faces Servlet");
and
this.getServletContext().getRequestDispatcher("/javax.faces.webapp.FacesServlet"));
both are returing null.how i can get hold of faceservlet from login servlet.
Thanks in advance...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

If, as I think you're saying, you want to accept a login and (if successful) forward to a JSF pag view. In this case, the URL of the JSF page yo want to bring up is what you want to be forwarding to. The Faces Servlet will be invoked automatically when you do that.


Customer surveys are for companies who didn't pay proper attention to begin with.
Davie Lin
Ranch Hand

Joined: Aug 05, 2007
Posts: 294
Hi Tim, does that mean we pretty much never need to implement a type of FacesServlet with a simple POJO backing bean?
Are you aware of any situations that I would need to implement a type of FacesServlet. appreciated if you can share them.

Sorry this thread is old.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Davie Lin wrote:Hi Tim, does that mean we pretty much never need to implement a type of FacesServlet with a simple POJO backing bean?
Are you aware of any situations that I would need to implement a type of FacesServlet. appreciated if you can share them.

Sorry this thread is old.


It's not just old, it's a Zombie. We'd rather you started a whole new thread, actually. See the "Don't wake the zombies" hint in the FAQ.

And, no, if you want to use JSF, you have to route your request through the FacesServlet. JSF is a MVC architecture, and in fact, it's designed specifically for backing beans to be POJOs as much as is possible. The Faces Servlet is the central Controller component, so it's needed to connect the Model (POJO) to the View (JSF web page).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invoking face servlet