Difference between revisions of "Java-Business-Application/C2/Creating-a-Java-web-project/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 9: Line 9:
 
|-
 
|-
 
|  00:06
 
|  00:06
|  In this tutorial we will learn :
+
|  In this tutorial, we will learn  
  
 
|-
 
|-
 
|  00:09
 
|  00:09
| To create a '''Java Web Project'''
+
| to create a '''Java Web Project''':
  
 
|-
 
|-
 
|  00:12
 
|  00:12
| About '''Deployment Descriptor'''
+
|* About '''Deployment Descriptor'''
  
 
|-
 
|-
 
|  00:15
 
|  00:15
| About '''web.xml''' file
+
|* About '''web.xml''' file.
  
 
|-
 
|-
 
| 00:19
 
| 00:19
| Here we are using
+
| Here we are using:
  
 
|-
 
|-
Line 45: Line 45:
 
|-
 
|-
 
|  00:32
 
|  00:32
|You can use any web-browser of your choice
+
|You can use any web-browser of your choice.
  
 
|-
 
|-
 
| 00:35
 
| 00:35
| To follow this tutorial you must have knowledge of
+
| To follow this tutorial, you must have knowledge of:
  
 
|-
 
|-
Line 57: Line 57:
 
|-
 
|-
 
|  00:42
 
|  00:42
| '''HTML'''
+
| '''HTML'''.
  
 
|-
 
|-
Line 69: Line 69:
 
|-
 
|-
 
|  00:56
 
|  00:56
| For this we will switch to '''Netbeans IDE'''.
+
| For this, we will switch to '''Netbeans IDE'''.
  
 
|-
 
|-
Line 81: Line 81:
 
|-
 
|-
 
|01:12
 
|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.'''
  
 
|-
 
|-
Line 89: Line 89:
 
|-
 
|-
 
|  01:20
 
|  01:20
| On the next window that opens.
+
| On the next window that opens
  
 
|-
 
|-
 
|01:23
 
|01:23
| Type the '''Project Name '''as '''MyFirstProject.'''
+
| type the '''Project Name '''as '''MyFirstProject.'''
  
 
|-
 
|-
 
| 01:27
 
| 01:27
| Leave the '''Project location''' and '''project folder''' as it is
+
| Leave the '''Project location''' and '''project folder''' as it is.
  
 
|-
 
|-
 
|  01:31
 
|  01:31
|  Then, Click on '''Next.'''
+
|  Then, click on '''Next.'''
  
 
|-
 
|-
Line 117: Line 117:
 
|-
 
|-
 
|  01:50
 
|  01:50
|  Now, Click on '''Next '''and then click on '''Finish.'''
+
|  Now, click on '''Next '''and then click on '''Finish.'''
  
 
|-
 
|-
 
|  01:55
 
|  01:55
|  Click on the  '''Projects''' tab,
+
|  Click on the  '''Projects''' tab.
  
 
|-
 
|-
 
|  01:58
 
|  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 named '''My First Project''' has been created.
  
 
|-
 
|-
Line 141: Line 141:
 
|-
 
|-
 
|  02:21
 
|  02:21
|  A '''web application'''’s '''deployment descriptor '''describes:
+
|  A '''web application'''’s '''deployment descriptor '''describes
  
 
|-
 
|-
Line 149: Line 149:
 
|-
 
|-
 
|  02:31
 
|  02:31
|  how the '''web server''' uses them to serve web requests
+
|  how the '''web server''' uses them to serve web requests.
  
 
|-
 
|-
Line 185: Line 185:
 
|-
 
|-
 
| 03:19
 
| 03:19
|  And From the '''File Types, ''' choose  '''Standard Deployment Descriptor(web.xml).'''
+
|  And from the '''File Types, ''' choose  '''Standard Deployment Descriptor(web.xml).'''
  
 
|-
 
|-
Line 193: Line 193:
 
|-
 
|-
 
| 03:27
 
| 03:27
| And Click on '''Finish.'''
+
| And click on '''Finish.'''
  
 
|-
 
|-
Line 205: Line 205:
 
|-
 
|-
 
|  03:42
 
|  03:42
| You can see the '''Source ''' code now.
+
| You can see the '''source  code''' now.
  
 
|-
 
|-
Line 241: Line 241:
 
|-
 
|-
 
|04:20
 
|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:27
 
|04:27
| A browser windows open up and displays ''' Hello World '''
+
| A browser window opens up and displays ''' Hello World '''.
  
 
|-
 
|-
Line 261: Line 261:
 
|-
 
|-
 
|  04:49
 
|  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!'''
  
 
|-
 
|-
Line 277: Line 277:
 
|-
 
|-
 
|  05:10
 
|  05:10
|  We can see the source code here.
+
|  We can see the '''source code''' here.
  
 
|-
 
|-
Line 285: Line 285:
 
|-
 
|-
 
|  05:17
 
|  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'''.
  
 
|-
 
|-
Line 301: Line 301:
 
|-
 
|-
 
|  05:41
 
|  05:41
|Now, come back to the browser
+
|Now, come back to the browser.
  
 
|-
 
|-
 
|  05:44
 
|  05:44
|  Type the ''' URL ''' as '''localhost''''' colon '''''8080.''' and press Enter
+
|  Type the ''' URL ''' as '''localhost''''' colon '''''8080.''' and press '''Enter'''.
  
 
|-
 
|-
 
| 05:50
 
| 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:56
 
| 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.
  
 
|-
 
|-
Line 321: Line 321:
 
|-
 
|-
 
|  06:08
 
|  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:15
 
|  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.
  
 
|-
 
|-
Line 337: Line 337:
 
|-
 
|-
 
|  06:27
 
|  06:27
|  So we see '''Hello World''' displayed
+
|  So we see '''Hello World''' displayed.
  
 
|-
 
|-
Line 345: Line 345:
 
|-
 
|-
 
|  06:32
 
|  06:32
| In this tutorial we have learnt  
+
| In this tutorial we have learnt:
  
 
|-
 
|-
 
|  06:35
 
|  06:35
|  To create a simple '''Java Web''' '''project'''
+
|* To create a simple '''Java Web''' '''project'''
  
 
|-
 
|-
 
|  06:38
 
|  06:38
| Execute the '''web''' project
+
|* Execute the '''web''' project
  
 
|-
 
|-
 
|  06:41
 
|  06:41
|  and about the '''web.xml''' file
+
|* and about the '''web.xml''' file.
  
 
|-
 
|-
 
| 06:44
 
| 06:44
| To know more about this spoken tutorial  project  
+
| To know more about this spoken tutorial  project,
  
 
|-
 
|-
 
| 06:46
 
| 06:46
|Watch the video available at the following link
+
|watch the video available at the following link.
  
 
|-
 
|-
 
| 06:50
 
| 06:50
| It summarizes the Spoken Tutorial project
+
| It summarizes the Spoken Tutorial project.
  
 
|-
 
|-
 
|  06:54
 
|  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:58
 
|06:58
| The Spoken Tutorial Project Team
+
| The Spoken Tutorial Project Team:
  
 
|-
 
|-
Line 385: Line 385:
 
|-
 
|-
 
|  07:04
 
|  07:04
|  Gives certificates for those who pass an online test
+
|  Gives certificates for those who pass an online test.
  
 
|-
 
|-
 
|  07: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:13
 
|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:17
 
|  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:23
 
|  07:23
|  More information on this Mission is available at
+
|  More information on this mission is available at-
  
 
|-
 
|-
Line 417: Line 417:
 
|-
 
|-
 
|  07:48
 
|  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 21:08, 13 June 2015

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 named 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 window opens 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.

Contributors and Content Editors

PoojaMoolya, Pratik kamble, Sandhya.np14