Difference between revisions of "Java-Business-Application/C2/Creating-a-Java-web-project/English-timed"
From Script | Spoken-Tutorial
PoojaMoolya (Talk | contribs) |
|||
Line 1: | Line 1: | ||
{| border=1 | {| border=1 | ||
− | | | + | |'''Time''' |
− | | | + | |'''Narration''' |
|- | |- | ||
− | | 00 | + | | 00:00 |
− | | Welcome to the spoken-tutorial on''' Creating a Java Web Project.''' | + | | Welcome to the spoken-tutorial on '''Creating a Java Web Project.''' |
|- | |- | ||
− | | 00 | + | | 00:06 |
| In this tutorial we will learn : | | In this tutorial we will learn : | ||
|- | |- | ||
− | | 00 | + | | 00:09 |
− | | To create a '''Java''' | + | | To create a '''Java Web Project''' |
|- | |- | ||
− | | 00 | + | | 00:12 |
− | | About Deployment Descriptor | + | | About '''Deployment Descriptor''' |
|- | |- | ||
− | | 00 | + | | 00:15 |
− | | About '''web.xml '''file | + | | About '''web.xml''' file |
|- | |- | ||
− | | 00 | + | | 00:19 |
| Here we are using | | Here we are using | ||
|- | |- | ||
− | | 00 | + | | 00:20 |
− | | Ubuntu Version 12.04 | + | | '''Ubuntu Version''' 12.04 |
|- | |- | ||
− | | 00 | + | | 00:23 |
− | | Netbeans IDE 7.3 | + | | '''Netbeans IDE''' 7.3 |
|- | |- | ||
− | | 00 | + | | 00:26 |
− | | JDK 1.7 | + | | '''JDK''' 1.7 |
|- | |- | ||
− | | 00 | + | | 00:28 |
− | | Firefox web-browser 21.0 | + | | '''Firefox''' web-browser 21.0 |
|- | |- | ||
− | | 00 | + | | 00:32 |
|You can use any web-browser of your choice | |You can use any web-browser of your choice | ||
|- | |- | ||
− | | 00 | + | | 00:35 |
| To follow this tutorial you must have knowledge of | | To follow this tutorial you must have knowledge of | ||
|- | |- | ||
− | | 00 | + | | 00:39 |
| '''Core Java''' using '''Netbeans IDE''' and | | '''Core Java''' using '''Netbeans IDE''' and | ||
|- | |- | ||
− | | 00 | + | | 00:42 |
| '''HTML''' | | '''HTML''' | ||
|- | |- | ||
− | | 00 | + | | 00:44 |
| If not, for relevant tutorials please visit our website. | | If not, for relevant tutorials please visit our website. | ||
|- | |- | ||
− | | 00 | + | | 00:50 |
− | | Now, let us see how to create a simple '''Java Web Project ''' | + | | Now, let us see how to create a simple '''Java Web Project using''' '''Netbeans IDE'''. |
|- | |- | ||
− | | 00 | + | | 00:56 |
− | | For this we will switch to''' Netbeans IDE'''. | + | | For this we will switch to '''Netbeans IDE'''. |
|- | |- | ||
− | | 01 | + | | 01:01 |
| On the top left corner of the IDE, Click on '''File '''and click on '''New Project.''' | | On the top left corner of the IDE, Click on '''File '''and click on '''New Project.''' | ||
|- | |- | ||
− | | 01 | + | | 01:08 |
| A '''New Project '''window opens up. | | A '''New Project '''window opens up. | ||
|- | |- | ||
− | |01 | + | |01:12 |
− | | From the categories, choose '''Java Web '''and from the '''Projects '''choose '''Web Application.''' | + | | From the categories, choose '''Java Web '''and from the '''Projects''' choose '''Web Application.''' |
|- | |- | ||
− | | 01 | + | | 01:18 |
| Then click on '''Next.''' | | Then click on '''Next.''' | ||
|- | |- | ||
− | | 01 | + | | 01:20 |
− | | On the next | + | | On the next window that opens. |
|- | |- | ||
− | |01 | + | |01:23 |
| Type the '''Project Name '''as '''MyFirstProject.''' | | Type the '''Project Name '''as '''MyFirstProject.''' | ||
|- | |- | ||
− | | 01 | + | | 01:27 |
− | | Leave the Project location and project folder as it is | + | | Leave the '''Project location''' and '''project folder''' as it is |
|- | |- | ||
− | | 01 | + | | 01:31 |
| Then, Click on '''Next.''' | | Then, Click on '''Next.''' | ||
|- | |- | ||
− | | 01 | + | | 01:35 |
− | | Select''' GlassFish server '''as the ''' Server.''' | + | | Select '''GlassFish server''' as the '''Server.''' |
|- | |- | ||
− | | 01 | + | | 01:39 |
− | | Note that '''Context Path | + | | Note that '''Context Path''' here is '''MyFirstProject, ''' this is the same name as our '''Project.''' |
|- | |- | ||
− | | 01 | + | | 01:47 |
| We will learn about this in detail. | | We will learn about this in detail. | ||
|- | |- | ||
− | | 01 | + | | 01:50 |
| Now, Click on '''Next '''and then click on '''Finish.''' | | Now, Click on '''Next '''and then click on '''Finish.''' | ||
|- | |- | ||
− | | 01 | + | | 01:55 |
− | | Click on the '''Projects '''tab, | + | | Click on the '''Projects''' tab, |
|- | |- | ||
− | | 01 | + | | 01:58 |
| We can see there are several nodes here and a web application name '''My First Project''' has been created | | We can see there are several nodes here and a web application name '''My First Project''' has been created | ||
|- | |- | ||
− | | 02 | + | | 02:08 |
| Now, We are not concerned about all of these nodes right now. | | Now, We are not concerned about all of these nodes right now. | ||
|- | |- | ||
− | | 02 | + | | 02:11 |
| But let me click and show you, what it contains. | | But let me click and show you, what it contains. | ||
|- | |- | ||
− | | 02 | + | | 02:16 |
|Now let us learn about what is known as '''Deployment Descriptor.''' | |Now let us learn about what is known as '''Deployment Descriptor.''' | ||
|- | |- | ||
− | | 02 | + | | 02:21 |
| A '''web application'''’s '''deployment descriptor '''describes: | | A '''web application'''’s '''deployment descriptor '''describes: | ||
|- | |- | ||
− | | 02 | + | | 02:25 |
− | | the '''classes''', resources and configuration of the application and | + | | the '''classes''', '''resources''' and '''configuration''' of the '''application''' and |
|- | |- | ||
− | | 02 | + | | 02:31 |
| how the '''web server''' uses them to serve web requests | | how the '''web server''' uses them to serve web requests | ||
|- | |- | ||
− | | 02 | + | | 02:37 |
| The '''web server''' receives a request for the application. | | The '''web server''' receives a request for the application. | ||
|- | |- | ||
− | | 02 | + | | 02:42 |
| It uses''' deployment descriptor '''to map the''' URL''' of the request. | | It uses''' deployment descriptor '''to map the''' URL''' of the request. | ||
|- | |- | ||
− | | 02 | + | | 02:48 |
| It maps the''' URL '''to the code that has to handle the request. | | It maps the''' URL '''to the code that has to handle the request. | ||
|- | |- | ||
− | | 02 | + | | 02:52 |
| The '''deployment descriptor''' is a file named '''web.xml'''. | | The '''deployment descriptor''' is a file named '''web.xml'''. | ||
|- | |- | ||
− | | 02 | + | | 02:57 |
− | |Now let us come back to the IDE | + | |Now let us come back to the '''IDE.''' |
|- | |- | ||
− | | 03 | + | | 03:00 |
| We are not able to find the '''web.xml '''file from the nodes available here. | | We are not able to find the '''web.xml '''file from the nodes available here. | ||
|- | |- | ||
− | | 03 | + | | 03:07 |
| To locate it, at the top left of the '''IDE''', click on '''File''', and then click on '''New File'''. | | To locate it, at the top left of the '''IDE''', click on '''File''', and then click on '''New File'''. | ||
|- | |- | ||
− | | 03 | + | | 03:16 |
| From the '''Categories''', choose '''Web.''' | | From the '''Categories''', choose '''Web.''' | ||
|- | |- | ||
− | | 03 | + | | 03:19 |
| And From the '''File Types, ''' choose '''Standard Deployment Descriptor(web.xml).''' | | And From the '''File Types, ''' choose '''Standard Deployment Descriptor(web.xml).''' | ||
|- | |- | ||
− | | 03 | + | | 03:25 |
| Then click on '''Next.''' | | Then click on '''Next.''' | ||
|- | |- | ||
− | | 03 | + | | 03:27 |
| And Click on '''Finish.''' | | And Click on '''Finish.''' | ||
|- | |- | ||
− | | 03 | + | | 03:30 |
| Click on the '''Files''' tab on the left hand side of the '''IDE.''' | | Click on the '''Files''' tab on the left hand side of the '''IDE.''' | ||
|- | |- | ||
− | | 03 | + | | 03:34 |
− | | Note that '''web.xml '''is visible under the '''WEB-INF '''folder of the '''Web''' node. | + | | Note that '''web.xml '''is visible under the '''WEB-INF'''folder of the '''Web''' node. |
|- | |- | ||
− | | 03 | + | | 03:42 |
| You can see the '''Source ''' code now. | | You can see the '''Source ''' code now. | ||
|- | |- | ||
− | | 03 | + | | 03:46 |
| We have an '''xml''' header here. | | We have an '''xml''' header here. | ||
|- | |- | ||
− | | 03 | + | | 03:50 |
| We also have a '''web-app '''node. | | We also have a '''web-app '''node. | ||
|- | |- | ||
− | | 03 | + | | 03:53 |
| Now, we shall try running the application. | | Now, we shall try running the application. | ||
|- | |- | ||
− | | 03 | + | | 03:57 |
| To do so, right click on '''MyFirstProject.''' | | To do so, right click on '''MyFirstProject.''' | ||
|- | |- | ||
− | | 04 | + | | 04:02 |
| Click on '''Clean and Build.''' | | Click on '''Clean and Build.''' | ||
|- | |- | ||
− | | 04 | + | | 04:04 |
| This will delete any previously compiled files and other build outputs. | | This will delete any previously compiled files and other build outputs. | ||
|- | |- | ||
− | | 04 | + | | 04:10 |
| It will also recompile the application. | | It will also recompile the application. | ||
|- | |- | ||
− | | 04 | + | | 04:14 |
| Again, right click on '''MyFirstProject '''and then click on '''Run.''' | | Again, right click on '''MyFirstProject '''and then click on '''Run.''' | ||
|- | |- | ||
− | |04 | + | |04:20 |
| So the server is up and running and it has deploy '''My first Project''' | | So the server is up and running and it has deploy '''My first Project''' | ||
|- | |- | ||
− | |04 | + | |04:27 |
| A browser windows open up and displays ''' Hello World ''' | | A browser windows open up and displays ''' Hello World ''' | ||
|- | |- | ||
− | | 04 | + | | 04:32 |
| This is because when we run the '''project''', the '''web application '''renders the page shown. | | This is because when we run the '''project''', the '''web application '''renders the page shown. | ||
|- | |- | ||
− | | 04 | + | | 04:39 |
| Now, let’s have a look at the''' URL ''' here that rendered the page. | | Now, let’s have a look at the''' URL ''' here that rendered the page. | ||
|- | |- | ||
− | | 04 | + | | 04:44 |
| It is '''localhost '''''colon'' '''8080''' ''slash'' '''MyFirstProject.''' | | It is '''localhost '''''colon'' '''8080''' ''slash'' '''MyFirstProject.''' | ||
|- | |- | ||
− | | 04 | + | | 04:49 |
| So when we run '''MyFirstProject '''by default we get a '''JSP '''page that says '''HelloWorld!''' | | So when we run '''MyFirstProject '''by default we get a '''JSP '''page that says '''HelloWorld!''' | ||
|- | |- | ||
− | | 04 | + | | 04:57 |
| Now, let us come back to our '''IDE'''. | | Now, let us come back to our '''IDE'''. | ||
|- | |- | ||
− | | 05 | + | | 05:00 |
− | | We can see that under the '''WEB-INF '''folder there is '''index | + | | We can see that under the '''WEB-INF '''folder there is '''index.jsp.''' |
|- | |- | ||
− | | 05 | + | | 05:07 |
| Double click on '''index.jsp'''. | | Double click on '''index.jsp'''. | ||
|- | |- | ||
− | | 05 | + | | 05:10 |
| We can see the source code here. | | We can see the source code here. | ||
|- | |- | ||
− | | 05 | + | | 05:12 |
| It is a simple '''JSP page''' with '''HTML tags '''only. | | It is a simple '''JSP page''' with '''HTML tags '''only. | ||
|- | |- | ||
− | | 05 | + | | 05:17 |
| It has the title ''' JSP Page''' and it has the heading '''Hello World''' | | It has the title ''' JSP Page''' and it has the heading '''Hello World''' | ||
− | |||
|- | |- | ||
− | | 05 | + | | 05:24 |
| The server provides '''index.jsp '''by default when we run the web application. | | The server provides '''index.jsp '''by default when we run the web application. | ||
|- | |- | ||
− | | 05 | + | | 05:30 |
| Recall that we had come across something called '''ContextPath''' earlier. | | Recall that we had come across something called '''ContextPath''' earlier. | ||
|- | |- | ||
− | | 05 | + | | 05:36 |
| We had set the '''ContextPath''' as '''MyFirstProject''' itself. | | We had set the '''ContextPath''' as '''MyFirstProject''' itself. | ||
|- | |- | ||
− | | 05 | + | | 05:41 |
|Now, come back to the browser | |Now, come back to the browser | ||
|- | |- | ||
− | | 05 | + | | 05:44 |
| Type the ''' URL ''' as '''localhost''''' colon '''''8080.''' and press Enter | | Type the ''' URL ''' as '''localhost''''' colon '''''8080.''' and press Enter | ||
− | |||
− | |||
|- | |- | ||
− | | 05 | + | | 05:50 |
| We see that the home page of '''Glassfish server '''is displayed. | | We see that the home page of '''Glassfish server '''is displayed. | ||
|- | |- | ||
− | | 05 | + | | 05:56 |
− | |Here 8080 is the default course at which the server runs on the machine. | + | |Here '''8080''' is the default course at which the server runs on the machine. |
|- | |- | ||
− | | 06 | + | | 06:01 |
| This '''Glassfish server''' instance may have many applications running on it. | | This '''Glassfish server''' instance may have many applications running on it. | ||
|- | |- | ||
− | | 06 | + | | 06:08 |
| To access a particular application type that application name in the '''URL'''. | | To access a particular application type that application name in the '''URL'''. | ||
|- | |- | ||
− | | 06 | + | | 06:15 |
| So,we must type the specific application that has been deployed on that instance. | | So,we must type the specific application that has been deployed on that instance. | ||
|- | |- | ||
− | | 06 | + | | 06:21 |
| So we will type ''' slash MyFirstProject '''. | | So we will type ''' slash MyFirstProject '''. | ||
|- | |- | ||
− | | 06 | + | | 06:26 |
| And Press '''Enter.''' | | And Press '''Enter.''' | ||
|- | |- | ||
− | | 06 | + | | 06:27 |
− | | So we see Hello World displayed | + | | So we see '''Hello World''' displayed |
|- | |- | ||
− | | 06 | + | | 06:31 |
| Let us summarize. | | Let us summarize. | ||
|- | |- | ||
− | | 06 | + | | 06:32 |
| In this tutorial we have learnt | | In this tutorial we have learnt | ||
|- | |- | ||
− | | 06 | + | | 06:35 |
| To create a simple '''Java Web''' '''project''' | | To create a simple '''Java Web''' '''project''' | ||
|- | |- | ||
− | | 06 | + | | 06:38 |
| Execute the '''web''' project | | Execute the '''web''' project | ||
|- | |- | ||
− | | 06 | + | | 06:41 |
| and about the '''web.xml''' file | | and about the '''web.xml''' file | ||
|- | |- | ||
− | | 06 | + | | 06:44 |
| To know more about this spoken tutorial project | | To know more about this spoken tutorial project | ||
|- | |- | ||
− | | 06 | + | | 06:46 |
|Watch the video available at the following link | |Watch the video available at the following link | ||
|- | |- | ||
− | | 06 | + | | 06:50 |
| It summarizes the Spoken Tutorial project | | It summarizes the Spoken Tutorial project | ||
− | |||
|- | |- | ||
− | | 06 | + | | 06:54 |
| If you do not have good bandwidth, you can download and watch it | | If you do not have good bandwidth, you can download and watch it | ||
|- | |- | ||
− | |06 | + | |06:58 |
| The Spoken Tutorial Project Team | | The Spoken Tutorial Project Team | ||
|- | |- | ||
− | | 07 | + | | 07:00 |
| Conducts workshops using spoken tutorials | | Conducts workshops using spoken tutorials | ||
|- | |- | ||
− | | 07 | + | | 07:04 |
| Gives certificates for those who pass an online test | | Gives certificates for those who pass an online test | ||
|- | |- | ||
− | | 07 | + | | 07:07 |
| For more details, please write to contact at spoken hyphen tutorial dot org | | For more details, please write to contact at spoken hyphen tutorial dot org | ||
|- | |- | ||
− | |07 | + | |07:13 |
| Spoken Tutorial Project is a part of the Talk to a Teacher project | | Spoken Tutorial Project is a part of the Talk to a Teacher project | ||
|- | |- | ||
− | | 07 | + | | 07:17 |
| It is supported by the National Mission on Education through ICT, MHRD, Government of India | | It is supported by the National Mission on Education through ICT, MHRD, Government of India | ||
|- | |- | ||
− | | 07 | + | | 07:23 |
| More information on this Mission is available at | | More information on this Mission is available at | ||
|- | |- | ||
− | | 07 | + | | 07:27 |
| http://spoken-tutorial.org/NMEICT- Intro | | http://spoken-tutorial.org/NMEICT- Intro | ||
|- | |- | ||
− | | 07 | + | | 07:34 |
| The '''Library Management System''' has been contributed by a leading software '''MNC''', through their '''Corporate Social Responsibility''' program. | | The '''Library Management System''' has been contributed by a leading software '''MNC''', through their '''Corporate Social Responsibility''' program. | ||
|- | |- | ||
− | | 07 | + | | 07:44 |
| They have also validated the content for this spoken tutorial. | | They have also validated the content for this spoken tutorial. | ||
|- | |- | ||
− | | 07 | + | | 07:48 |
| This is Arya Ratish from IIT Bombay signing off. | | This is Arya Ratish from IIT Bombay signing off. | ||
Thank you for joining. | Thank you for joining. | ||
|} | |} |
Revision as of 15:38, 18 September 2014
Time | Narration |
00:00 | Welcome to the spoken-tutorial on Creating a Java Web Project. |
00:06 | In this tutorial we will learn : |
00:09 | To create a Java Web Project |
00:12 | About Deployment Descriptor |
00:15 | About web.xml file |
00:19 | Here we are using |
00:20 | Ubuntu Version 12.04 |
00:23 | Netbeans IDE 7.3 |
00:26 | JDK 1.7 |
00:28 | Firefox web-browser 21.0 |
00:32 | You can use any web-browser of your choice |
00:35 | To follow this tutorial you must have knowledge of |
00:39 | Core Java using Netbeans IDE and |
00:42 | HTML |
00:44 | If not, for relevant tutorials please visit our website. |
00:50 | Now, let us see how to create a simple Java Web Project using Netbeans IDE.
|
00:56 | For this we will switch to Netbeans IDE. |
01:01 | On the top left corner of the IDE, Click on File and click on New Project. |
01:08 | A New Project window opens up. |
01:12 | From the categories, choose Java Web and from the Projects choose Web Application. |
01:18 | Then click on Next. |
01:20 | On the next window that opens. |
01:23 | Type the Project Name as MyFirstProject. |
01:27 | Leave the Project location and project folder as it is
|
01:31 | Then, Click on Next. |
01:35 | Select GlassFish server as the Server. |
01:39 | Note that Context Path here is MyFirstProject, this is the same name as our Project. |
01:47 | We will learn about this in detail. |
01:50 | Now, Click on Next and then click on Finish. |
01:55 | Click on the Projects tab, |
01:58 | We can see there are several nodes here and a web application name My First Project has been created |
02:08 | Now, We are not concerned about all of these nodes right now. |
02:11 | But let me click and show you, what it contains. |
02:16 | Now let us learn about what is known as Deployment Descriptor. |
02:21 | A web application’s deployment descriptor describes: |
02:25 | the classes, resources and configuration of the application and |
02:31 | how the web server uses them to serve web requests |
02:37 | The web server receives a request for the application. |
02:42 | It uses deployment descriptor to map the URL of the request. |
02:48 | It maps the URL to the code that has to handle the request. |
02:52 | The deployment descriptor is a file named web.xml. |
02:57 | Now let us come back to the IDE. |
03:00 | We are not able to find the web.xml file from the nodes available here. |
03:07 | To locate it, at the top left of the IDE, click on File, and then click on New File. |
03:16 | From the Categories, choose Web. |
03:19 | And From the File Types, choose Standard Deployment Descriptor(web.xml). |
03:25 | Then click on Next. |
03:27 | And Click on Finish. |
03:30 | Click on the Files tab on the left hand side of the IDE. |
03:34 | Note that web.xml is visible under the WEB-INFfolder of the Web node. |
03:42 | You can see the Source code now. |
03:46 | We have an xml header here. |
03:50 | We also have a web-app node. |
03:53 | Now, we shall try running the application. |
03:57 | To do so, right click on MyFirstProject. |
04:02 | Click on Clean and Build. |
04:04 | This will delete any previously compiled files and other build outputs. |
04:10 | It will also recompile the application. |
04:14 | Again, right click on MyFirstProject and then click on Run. |
04:20 | So the server is up and running and it has deploy My first Project |
04:27 | A browser windows open up and displays Hello World |
04:32 | This is because when we run the project, the web application renders the page shown. |
04:39 | Now, let’s have a look at the URL here that rendered the page. |
04:44 | It is localhost colon 8080 slash MyFirstProject.
|
04:49 | So when we run MyFirstProject by default we get a JSP page that says HelloWorld! |
04:57 | Now, let us come back to our IDE. |
05:00 | We can see that under the WEB-INF folder there is index.jsp. |
05:07 | Double click on index.jsp. |
05:10 | We can see the source code here. |
05:12 | It is a simple JSP page with HTML tags only. |
05:17 | It has the title JSP Page and it has the heading Hello World |
05:24 | The server provides index.jsp by default when we run the web application. |
05:30 | Recall that we had come across something called ContextPath earlier. |
05:36 | We had set the ContextPath as MyFirstProject itself. |
05:41 | Now, come back to the browser |
05:44 | Type the URL as localhost colon 8080. and press Enter |
05:50 | We see that the home page of Glassfish server is displayed. |
05:56 | Here 8080 is the default course at which the server runs on the machine. |
06:01 | This Glassfish server instance may have many applications running on it. |
06:08 | To access a particular application type that application name in the URL. |
06:15 | So,we must type the specific application that has been deployed on that instance. |
06:21 | So we will type slash MyFirstProject . |
06:26 | And Press Enter. |
06:27 | So we see Hello World displayed |
06:31 | Let us summarize. |
06:32 | In this tutorial we have learnt |
06:35 | To create a simple Java Web project |
06:38 | Execute the web project |
06:41 | and about the web.xml file |
06:44 | To know more about this spoken tutorial project |
06:46 | Watch the video available at the following link |
06:50 | It summarizes the Spoken Tutorial project |
06:54 | If you do not have good bandwidth, you can download and watch it |
06:58 | The Spoken Tutorial Project Team |
07:00 | Conducts workshops using spoken tutorials |
07:04 | Gives certificates for those who pass an online test |
07:07 | For more details, please write to contact at spoken hyphen tutorial dot org |
07:13 | Spoken Tutorial Project is a part of the Talk to a Teacher project |
07:17 | It is supported by the National Mission on Education through ICT, MHRD, Government of India |
07:23 | More information on this Mission is available at |
07:27 | http://spoken-tutorial.org/NMEICT- Intro |
07:34 | The Library Management System has been contributed by a leading software MNC, through their Corporate Social Responsibility program. |
07:44 | They have also validated the content for this spoken tutorial. |
07:48 | This is Arya Ratish from IIT Bombay signing off.
Thank you for joining. |