• 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

invoke face servlet from another front controller servlet  RSS feed

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we have one application that uses one front controller servlet,which invokes model via action and then sends it to view (jsp ),it is similar to struts.now we want to use JSF also in that application.
My question is how we can integrate our front controller servlet with face servlet.
[ June 08, 2007: Message edited by: indraNJ sen ]
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As your Front Controller is similar to Struts there are two books I have seen each with a chapter on how to convert from Struts to JSF if that is an option for you.

1. JavaServer Faces: the complete reference
2. Mastering JavaServer Faces (oreilly)
 
indra sen
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Majid.
It is like struts but not actually struts.
our front controller depends on which action name is passed invokes the command bean(action ) and views(jsp ).
our front controller manages the session,security.
so i can not bypass our front controller .
My question is can i invoke face servlet from our controller servlet?
Thanks in advance...
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not read the chapters that Majid refers to but we solved a similar problem. FacesServlet is mapped to a url pattern in web.xml - generally, /faces/* or *.faces or *.jsf. Dispatching a request from your controller to a resource matching the url pattern will invoke FacesServlet.

--
Joe
 
Majid Al-Fifi
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems you want to make your new UI development using JSF but don't want to change the old code. I see it very feasible.

I agree with Joseph that dispatching your request to the JSF servlet should work. I am trying to see what other important things you may need to consider.

What about the relation between your backing beans for the new JSF views and your actions you might have already?
How will you pass information from the UI components to the actions and reflect results of the actions back to the UI?

I really can't see the whole picture but it looks like an interesting journey.

Please let us know how it goes with you.

regards,
Majid
 
Bartender
Posts: 19668
92
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is quite feasible if you know what you're doing. The backing beans are ordinary JavaBeans for their corresponding scopes and they posess no inherent magic - a bean created by a Servlet or Struts Action in Session scope is completely the same as it would be if JSF created it and vice versa - there's no hidden payloads that get in the way of trading them back and forth.

Although this isn't true if you start adding framework-specific code to your bean class. Which is another reason why backing beans work best as "pure" JavaBeans and not framework-specific JavaBeans.
 
indra sen
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have not read the chapters that Majid refers to but we solved a similar problem. FacesServlet is mapped to a url pattern in web.xml - generally, /faces/* or *.faces or *.jsf. Dispatching a request from your controller to a resource matching the url pattern will invoke FacesServlet



Thanks Joseph.Can you send me some sample code of invoking face servlet from my front controller servlet.
Thanks in advance..
 
indra sen
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one help me with sample code.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!