• 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

Can I use jsps and jsfs both in my application?

 
Ranch Hand
Posts: 806
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody, I am Chaitanya, I got a doubt, can I use jsps and jsfs both in one single appliation, can a jsp communicate with jsf, besides I dont have any knowledge about jsf, I am just asking because I got a doubt.

Thank you all in advance. Have a good day.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSF pages are JSPs. (unless you are talking about Facelets, but that is a different topic) They just use a set of tag libraries that are specific to JSF and it's own lifecycle. JSF pages communicate via managed beans (some form of a controller). I don't know about communication between a non-JSF JSP and a JSF page itself via the managed bean. You'll probably have better luck with this in the JSF forum, so I'll move it there.
 
chaitanya karthikk
Ranch Hand
Posts: 806
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Gregg, actually I was in a dilemma where to post this question. At last I chose jsp forum.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hate to contradict you, Gregg, but JSP JSPs are not "real" JSPs!

JSF is a Model/View/Controller system where the ".jsp" or ".xhtml" files are View prototypes.

In a normal JSP, the JSP is compiled to produce a servlet and the tags are enlisted in the execution of that servlet. Also, the URL is implicitly mapped to that servlet. In JSF, a URL mapping in web.xml routes JSF URLs to the FacesServlet. The FacesServlet is responsible for getting the View Prototype compiled into internal JSF constructs. This is one of the prime reasons that logic-oriented JSTL and scriptlets give so many problems when used in JSF View definitions.

It is perfectly legal to mix JSPs, Servlets, and even other frameworks such as Struts into a JSF application. In some cases, that's even preferable, since, for example, it's easier for a custom servlet to create a PDF than to badger the JSF framework to do so, since JSF is normally trying to render HTML, not PostScript. The difference between a JSP and a ".jsp" that's actually a JSF View prototype is strictly in whether or not the URL that makes the request matches the pattern that maps URLs to go to the FacesServlet. If it matches, it's JSF. If it doesn't, it's processed as a traditional JSP. If the JSP has JSF tags but is executed as though it were a traditional JSP, unhappiness results, as many of us have discovered to our sorrow. For one thing, the FacesContext won't have been constructed.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:I hate to contradict you, Gregg, but JSP JSPs are not "real" JSPs!



Don't ever worry about that. As long as we get the right info out there, I'm all for being contradicted.
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gregg Bolinger wrote:

Tim Holloway wrote:I hate to contradict you, Gregg, but JSP JSPs are not "real" JSPs!



Don't ever worry about that. As long as we get the right info out there, I'm all for being contradicted.



Well, those of us who never make mistakes feel pain for those who do.

That should have been 'JSF JSPs are not "real" JSPs!'

I didn't make a mistake. My keyboard has a life of its own!
 
You didn't tell me he was so big. Unlike this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic