This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

invoking face servlet

 
indra sen
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17625
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Davie Lin
Ranch Hand
Posts: 294
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17625
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic