Today is Wednesday, 11th January 2017

Archive for May, 2015


JSF Tutorial #9: JavaServer Faces Tutorial (JSF 2.2) – JSF Behind the Scenes

In this video, I will give you a behind the scenes tour of JSF.

Please SUBSCRIBE to my YouTube channel.

 

Download JSF Source Code

# Video
1 Introduction
2 JavaServer Faces Overview
3 Setting up your Development Environment - Overview
4 Installing Tomcat - MS Windows
5 Installing Tomcat - Mac OS X
6 Installing Eclipse - MS Windows
7 Installing Eclipse - Mac OS X
8 Connecting Eclipse to Tomcat
9 JSF Behind the Scenes
10 JSF HelloWorld
11 Creating JSF HTML Forms
12 JSF Forms and Managed Beans
13 Drop-Down Lists - Part 1
14 Drop-Down Lists - Part 2
15 Radio Buttons
16 Check Boxes
17 Prepopulating Forms
18 Recommended JSF Books and Resources

Do You Need More Details?

  • Do you need to connect to a database?
  • Display SQL results in a HTML table?
  • Perform SQL insert, updates and deletes?
I have a premium course that shows you how to complete all of these tasks.
  • Database Integration with JDBC
  • Displaying Data in Lists and Tables
  • Validating HTML Forms
  • Implementing Business Logic with Managed Beans
  • Deploying applications with WAR Files
Read more about the premium course at http://www.luv2code.com/jsf-for-beginners

Follow luv2code with the links below:

– Website: http://www.luv2code.com
– YouTube: http://goo.gl/EV6Kwv
– Twitter: http://goo.gl/ALMzLG
– Facebook: http://goo.gl/8pDRdA

JSF Tutorial Transcript:

00:00
Hey. Welcome back. In this video we’re going to 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. Finally, we’ll discuss application support for JSF. We have a lot of stuff in store. Let’s go ahead and get started.

00:36
What makes up a JSF application as far as what’s required to build a JSF application? A JSF application is basically a set of webpages to lay out components. We’ll make use of special JSF technology called Facelets. Then also, a JSF application is composed of a set of managed beans. 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.

01:00
Then also there’s an idea of the web deployment descriptor or 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 requests. Then optionally you can have some additional application config files like to 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.

01:36
How does JSF work behind the scenes? We have a user over here. They’re in their browser. They’ll submit a request to our application server. This will come into our JSF Faces Servlet. 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. These managed beans are basically just beans that hold form data or talk to your back end processes, like maybe a database or something.

02:14
This Faces Servlet, it will determine which page that it needs to route to. It will route it to that appropriate webpage. I’m at the bottom here. We have xhtml. This webpage can make use of the managed beans also to maybe retrieve information or display information from the back end system. This webpage is rendered and sent back to the web browser. This webpage, 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. Anyway, that’s how JSF works at a very high level. Again, web browser makes the request of the servlet. Servlet will route it to the appropriate page, and the page renders the response.

03:00
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.

03:15
JSF has been around for a long time. JSF 1.0 was released in 2004; that’s ancient days. Then it was JSF 1.2 that came out in 2006. JSF 2.0 came out in 2009. That was aligned up with Java EE 6. Then most recently it’s JSF 2.2; that was released in 2013. That is Java EE 7. When you look for different information like books and so on, you want to 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. Now you also want to make sure that you have an application server that can support JSF 2.2. You want to make sure your app server has support for Java EE 7 or higher.

04:00
Now there’s a new version of JSF that’s coming out. I’ve been checking the different blog posts and so on. JSF 2.3 is slated to come out late 2016, early 2017. You can think it will hit mainstream around the 2017 time frame. Just a little indicator there. You can always go online and 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. Anyway, this course will focus on JSF 2.2.

04:34
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. When I say a Java EE 7 server, some examples included Jboss Wildfly 8, GlassFish 4, and so on. For your given app server you want to make sure that it supports Java EE 7 or higher. Not all of the servers are up to date so you want to make sure you look at the actual specs for your server accordingly. I know out of the box that Wildfly 8 and GlassFish 4 already have full support for Java EE 7. That includes the JSF 2.2 libraries. 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.

05:23
Now if you want to deploy with 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. That means that you need to bundle the JSF libraries in your war file application. 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. 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 checkbox that you need to set up in the Eclipse environments for getting this working. Anyway, that’s the big thing there.

06:03
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 gave you a discussion of the various JSF versions that are out there. 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!” app with JSF and then we’ll actually deploy to our application server. See you then.

Share


JSF Tutorial #8: JavaServer Faces Tutorial (JSF 2.2) – Connect Eclipse and Tomcat

In this video, I will show you how to connect Eclipse and Tomcat.

Please SUBSCRIBE to my YouTube channel.

 

Download JSF Source Code

# Video
1 Introduction
2 JavaServer Faces Overview
3 Setting up your Development Environment - Overview
4 Installing Tomcat - MS Windows
5 Installing Tomcat - Mac OS X
6 Installing Eclipse - MS Windows
7 Installing Eclipse - Mac OS X
8 Connecting Eclipse to Tomcat
9 JSF Behind the Scenes
10 JSF HelloWorld
11 Creating JSF HTML Forms
12 JSF Forms and Managed Beans
13 Drop-Down Lists - Part 1
14 Drop-Down Lists - Part 2
15 Radio Buttons
16 Check Boxes
17 Prepopulating Forms
18 Recommended JSF Books and Resources

Do You Need More Details?

  • Do you need to connect to a database?
  • Display SQL results in a HTML table?
  • Perform SQL insert, updates and deletes?
I have a premium course that shows you how to complete all of these tasks.
  • Database Integration with JDBC
  • Displaying Data in Lists and Tables
  • Validating HTML Forms
  • Implementing Business Logic with Managed Beans
  • Deploying applications with WAR Files
Read more about the premium course at http://www.luv2code.com/jsf-for-beginners

Follow luv2code with the links below:

– Website: http://www.luv2code.com
– YouTube: http://goo.gl/EV6Kwv
– Twitter: http://goo.gl/ALMzLG
– Facebook: http://goo.gl/8pDRdA

JSF Tutorial Transcript:

00:00
Hey. Welcome back. In this video, we’re going to connect Eclipse and Tomcat. So far in our video series, we’ve installed Tomcat and we’ve installed Eclipse and these are two separate applications, but what we want to do now is actually connect them together, so the main benefit is that once we connect Eclipse and Tomcat, then we can start Tomcat from Eclipse. Now also, this will make it very easy for us to deploy our applications directly to Tomcat. We won’t have to manually start or manually deploy. We can do all of this automatically within the Eclipse framework.

00:38
All right, so let’s go ahead and move into Eclipse and what we’re going to do here is we’re going to connect Eclipse to Tomcat. Down in our bottom center, we have a tab called “Servers.” Right now, we don’t have any servers installed, we’re going to follow the directions here in creating a new server, so we’ll go ahead and click that link to create a new server. This will bring us to a page. Eclipse supports a lot of different servers, but what we’re going to do here is make use of the Apache Tomcat server. Expand the folder here for Apache, scroll down and we’ll choose our version. We’re using Tomcat 8. Then we’ll go ahead and click on next.

01:19
Now, we need to tell Eclipse where Tomcat is installed. Wherever you have Tomcat installed in your directory, that’s the directory information you should give. Here, I’ll just kind of browse my file system and I know in this class, jsf-for-beginners, Apache Tomcat 8. That’s the directory that we’ve installed Tomcat for this training class. You may have it installed in a different directory, simply choose that directory accordingly, but for my example, I have jsf-for-beginners, Apache Tomcat 8. Then once you have that directory set up, then you can go ahead and hit “Finish” and this will go ahead and set up the configuration.

02:00
Right now, the server is actually stopped and we can actually start the server by just by making use of a right click. I can just right click on this item here and I can say, “Start server.” Right click, start. This will actually start up the server. We’ll see a lot of information on the console window on the far right. Eventually at the end, it’ll say, “Server startup in” X number of milliseconds. We know that our server started and running and we can also verify this by looking at the Server’s tab. It says that Tomcat 8 is started and it’s synchronized. This looks really good. Our Tomcat server started and we’re able to launch it from the Eclipse application.

02:46
This looks good. In our next video, I’ll actually show you how to deploy a JSF application on the Tomcat server, but the main focus of this video is just starting Tomcat from Eclipse. All right, so this wraps up the video. In this video, I showed you how to connect Eclipse and Tomcat together and so we found out how we can actually start the Tomcat server from within Eclipse.

Share


JSF Tutorial #7: JavaServer Faces Tutorial (JSF 2.2) – Install Eclipse on Mac OS X

In this video, I will show you how to install Eclipse on Mac OS X.

Please SUBSCRIBE to my YouTube channel.

 

Download JSF Source Code

# Video
1 Introduction
2 JavaServer Faces Overview
3 Setting up your Development Environment - Overview
4 Installing Tomcat - MS Windows
5 Installing Tomcat - Mac OS X
6 Installing Eclipse - MS Windows
7 Installing Eclipse - Mac OS X
8 Connecting Eclipse to Tomcat
9 JSF Behind the Scenes
10 JSF HelloWorld
11 Creating JSF HTML Forms
12 JSF Forms and Managed Beans
13 Drop-Down Lists - Part 1
14 Drop-Down Lists - Part 2
15 Radio Buttons
16 Check Boxes
17 Prepopulating Forms
18 Recommended JSF Books and Resources

Do You Need More Details?

  • Do you need to connect to a database?
  • Display SQL results in a HTML table?
  • Perform SQL insert, updates and deletes?
I have a premium course that shows you how to complete all of these tasks.
  • Database Integration with JDBC
  • Displaying Data in Lists and Tables
  • Validating HTML Forms
  • Implementing Business Logic with Managed Beans
  • Deploying applications with WAR Files
Read more about the premium course at http://www.luv2code.com/jsf-for-beginners

Follow luv2code with the links below:

– Website: http://www.luv2code.com
– YouTube: http://goo.gl/EV6Kwv
– Twitter: http://goo.gl/ALMzLG
– Facebook: http://goo.gl/8pDRdA

JSF Tutorial Transcript:

00:00
Hey, welcome back to the JSF tutorial. In this video, I’m going to show you how to install Eclipse on the Mac. In particular, we are going to install the Java EE version of Eclipse, because that has built-in support for JSF. Okay, let’s go ahead and get started.

00:18
All right, so the first thing we need to do is download Eclipse. In our browser, we will just visit Eclipse.org. This will bring us to the Eclipse website, and over on the far right is a download button. Let’s go ahead and click on that button, and this will take us to the download page. All right, so now we are at the download page. Let’s scroll down a bit, and we want to make use of the Eclipse IDE for Java EE developers. It’s really important. Java EE version. The Java EE version has built-in support for JSF.

00:53
Let’s go ahead and click on the download link here. I’m using a Mac right now, so I will download that version. That will take us to the download page. I will go ahead and click the option here for the download mirror. The browser will prompt me to download the file. I’ll go ahead and hit okay. Then we will start downloading it to our system. This will take a while, so what I’ll do is I’ll kind of step away, and I’ll come back once the download is complete.

01:24
All right, so we have downloaded the file. Now what we need to do is unzip Eclipse. The first thing I do is I’ll move into the downloads directory, and there’s the file that we just downloaded, the Eclipse Java EE. I’ll go ahead and double-click this file to unzip it. All right. Now what I’d like to do, now that this file is unzipped … what I’d like to do is move it to my JSF for Beginners folder that I created in a previous video. Let me go ahead and open up a new Finder window here. Just resize the windows. Give me one second.

02:00
At the bottom, I have my JSF for Beginners. That’s the one that we created in our previous Mac video. I will go ahead and double-click in there. That’s where we installed our Tomcat from the previous video. I’ll take this Eclipse folder that I just unzipped, and I’ll move it down to that JSF for Beginners folder. Again, this JSF for Beginners folder is just a little scratch sample folder that we are going to use for our JSF class, just to keep everything in one location. Good, we just simply move that from downloads over to our JSF for Beginners. Good job.

02:33
All right, so now that we have the file in our JSF for Beginners directory, let’s go ahead and run Eclipse. I will simply select the Eclipse icon in this Eclipse folder, and I will just double-click it, and this will start up Eclipse for me. I will go ahead and hit open to start it to run. Then they are going to prompt me for a workspace. A workspace is simply a folder where we put our sample code. Normally, I would keep the defaults, but in this example, I’m going to change it. I’m going to click on browse, and I’ll move over to this JSF for Beginners directory, and then in the bottom left, I’m going to click on that button there for a new folder. For new folder, I’ll just type in the name of “workspace.” I’ll create a new workspace folder here in JSF for Beginners.

03:18
Hit okay, and so this what the layout should look like once we have that setup. Again, you can put your workspace anywhere you like, but I’m just putting it here in this one directory, just so it keeps track of everything else for this JSF for Beginners class. All right, so once I’m happy with that, I go ahead and hit on okay. Eclipse will start running, and then I’ll make it to the welcome screen. I always like to verify that I’m using the Java EE version of Eclipse because it has built-in support for JSF. I go ahead and close this welcome. Over on the left-hand side, I have my project explorer. Right now, it’s empty. Nothing’s there.

03:53
That’s it. At this point, we have Eclipse installed, and we’re able to run it. Everything looks really good. Good job so far. All right so this wraps up the video. In this video, I showed you how to install Eclipse on the Mac. I also showed you how to download the file, unzip it, and then launch Eclipse.

Share