Narrator: Hey, welcome back.
In this video, we're gonna get
a behind-the-scenes tour of JSF.
We'll cover the following topics.
First off, we'll take a look at the components
of a JSF application, then we'll take a sneak peak
behind the scenes to see how JSF actually works.
Next, we'll discuss the various JSF versions
that are out there,
and finally we'll discuss application support for JSF.
Alright, so we have a lot of stuff in store.
Let's go ahead and get started.
Alright, so what makes up a JSF application
as far as what's required to build a JSF application?
Well, a JSF application is basically a set of web pages
to lay out components.
We'll make use of special JSF technology called Facelets.
And then also a JSF application is composed
of a set of managed beans.
So this is Java code that you'll have in the background
for holding your form data, and also performing
your back-end operations like talking to a database.
Then also, there's an idea
of the web deployment descriptor on your web.xml.
If you've done some web development before with Java,
you may have seen this file before for Servlets and JSPs.
We'll basically put a special configuration in that file
to handle the JSF request.
And then optionally, you can have
some additional application config files,
like the faces-config.xml.
You can drop in some custom objects, components,
custom tags, and validators.
We'll talk about all that stuff later,
but at a very high level,
these are the actual components of a JSF application.
Alright, so how does JSF work behind the scenes?
So we have a user over here, they're on their browser,
they'll submit a request to our application server.
This'll come into our JSF Faces Servlet.
So this Faces Servlet is part of the JSF library.
You, the developer, you don't have to write this Servlet,
it's given to you.
This Faces Servlet handles routing the request
to the appropriate pages.
Now, this Faces Servlet, in the background,
it can read information from the Faces config file.
It can also make use of managed beans.
And these managed beans are basically just beans
that hold form data, or talk to your back-end processes
like maybe a database or something.
Alright, so this Faces Servlet, it'll determine
which page that it needs to rout to,
it'll route it to that appropriate web page.
At the bottom, here, we have xhtml.
This web page can make use of the managed beans, also,
to maybe retrieve information, or display information
from the back-end system, and this web page is rendered
and sent back to the web browser.
So this web page, it could have very basic information
like hey, welcome, and give the user's name.
Or, this webpage could be more sophisticated
where it would display the results of a database query.
But anyway, that's how JSF works at a very high level.
So again, web browser makes the request to the Servlet,
Servlet will route it to the appropriate page,
and the page renders the response.
Alright, so let's talk about the different versions of JSF.
There's a lot of different versions
that are floating out there,
so if you Google for some JSF tutorials,
you may find some outdated information.
So I just wanted to lay out the versions,
and then talk about JSF 2.2.
So, JSF has been around for a long time.
So JSF 1.0 was released in 2004,
so that's ancient days, alright?
Then there was JSF 1.2, that came out in 2006.
JSF 2.0 came out in 2009,
and that was aligned up with the Jave EE 6.
And then most recently, it's JSF 2.2
that was released in 2013, and that's Java EE 7.
So when you look for different information
like books and so on, you wanna make sure
that you're using at least JSF 2.2,
because there was some significant changes between 2.2
and all the previous versions, alright?
Now, you also wanna make sure that you have
an application server that can support JSF 2.2.
So you wanna make sure your app server has support
for Java EE 7 or higher.
Now there's a new version of JSF that's coming out,
I've been checking the different blog posts and so on,
and JSF 2.3 is slated to come out late 2016, early 2017.
So you can kinda think it'll hit mainstream
around the 2017 timeframe, so just a little indicator there.
But you can always go online to Google,
and you can simply say JSF release date,
and you should get the latest hits as far as news reports
on when JSF is coming out.
But anyway, this course will focus on JSF 2.2.
In terms of application server support,
if you make use of a full Java EE 7 server,
then the JSF 2.2 libraries are already included.
So, when I say a Java EE 7 server, some examples include
JBoss Wildfly 8, GlassFish 4, and so on.
So for you to give an app server,
you wanna make sure that it supports Java EE 7 or higher.
Not all of the servers are up to date,
so you wanna make sure you look at the actual specs
for your server accordingly.
But I know out of the box at Wildfly 8 and GlassFish 4
already have full support for Java EE 7,
and so that includes the JSF 2.2 libraries.
So the key thing here is that when you deploy
your JSF application, there's no need to include
the JSF JAR files in your app.
It's already part of those given server environments.
Now, if you wanna deploy a Tomcat 8, you can still do that.
The only thing is that you simply need to add
the JSF libraries, preferably JSF 2.2 or higher.
So that means that you need to bundle the JSF libraries
in your WAR file application.
So in your WEB-INF lib directory,
you'll need to include those JAR files.
I'll show you how to do this in the next video
when we build our Hello World application.
So don't worry if you don't totally understand all of this,
I'll walk through the steps when we go through
our Hello World app and show you which check box
that you need to set up in the Eclipse and Environments
for getting this work in, alright?
But anyway, that's the big thing there.
Alright, so this wraps up the video.
We covered some good items in this video.
We discussed the components of a JSF application.
We also learned how JSF works behind the scenes.
I also have you a discussion of the various JSF versions
that are out there, and then finally we wrapped up
by discussing application server support for JSF.
Stay tuned.
In the next video, we'll actually get our hands dirty.
We'll build a Hello World application with JSF,
and then we'll actually deploy it to our application server.
See you then.