Senin, 24 April 2017

Web Development Eclipse


welcome to the spoken-tutorial on creating a java web project. in this tutorial we will learn : to create a java web project about deployment descriptor about web.xml file here we are using ubuntu version 12.04 netbeans ide 7.3 jdk 1.7

firefox web-browser 21.0 you can use any web-browser of your choice to follow this tutorial you must have knowledge of core java using netbeans ide and html if not, for relevant tutorials please visit our website. now, let us see how to create a simple java web project using netbeans ide. for this we will switch to netbeans ide. on the top left corner of the ide, click on file and click on new project.

a new project window opens up. from the categories, choose java web and from the projects choose web application. then click on next. on the next window that opens. type the project name as myfirstproject. leave the project location and project folder as it is then, click on next. select glassfish server as the server. note that context path here is myfirstproject, this is the same name as our project.

we will learn about this in detail. now, click on next and then click on finish. click on the projects tab, we can see there are several nodes here and a web application name my first project has been created now, we are not concerned about all of these nodes right now. but let me click and show you, what it contains. now let us learn about what is known as deployment descriptor. a web application̢۪s deployment descriptor describes: the classes, resources and configuration of the application and

how the web server uses them to serve web requests the web server receives a request for the application. it uses deployment descriptor to map the url of the request. it maps the url to the code that has to handle the request. the deployment descriptor is a file named web.xml. now let us come back to the ide. we are not able to find the web.xml file from the nodes available here. to locate it, at the top left of the ide, click on file, and then click on new file. from the categories, choose web.

and from the file types, choose standard deployment descriptor(web.xml). and click on finish. click on the files tab on the left hand side of the ide. note that web.xml is visible under the web-inffolder of the web node. you can see the source code now. we have an xml header here. we also have a web-app node. now, we shall try running the application. to do so, right click on myfirstproject.

click on clean and build. this will delete any previously compiled files and other build outputs. it will also recompile the application. again, right click on myfirstproject and then click on run. so the server is up and running and it has deploy my first project a browser windows open up and displays hello world this is because when we run the project, the web application renders the page shown. now, let̢۪s have a look at the url here that rendered the page. it is localhost colon 8080 slash myfirstproject.

so when we run myfirstproject by default we get a jsp page that says helloworld! now, let us come back to our ide. we can see that under the web-inf folder there is index.jsp. double click on index.jsp. we can see the source code here. it is a simple jsp page with html tags only. it has the title jsp page and it has the heading hello world the server provides index.jsp by default when we run the web application. recall that we had come across something called contextpath earlier.

we had set the contextpath as myfirstproject itself. now, come back to the browser type the url as localhost colon 8080. and press enter we see that the home page of glassfish server is displayed. here 8080 is the default course at which the server runs on the machine. this glassfish server instance may have many applications running on it. to access a particular application type that application name in the url. so,we must type the specific application that has been deployed on that instance. so we will type slash myfirstproject .

and press enter. so we see hello world displayed let us summarize. in this tutorial we have learnt to create a simple java web project execute the web project and about the web.xml file to know more about this spoken tutorial project watch the video available at the following link

it summarizes the spoken tutorial project if you do not have good bandwidth, you can download and watch it the spoken tutorial project team conducts workshops using spoken tutorials gives certificates for those who pass an online test for more details, please write to contact at spoken hyphen tutorial dot org spoken tutorial project is a part of the talk to a teacher project it is supported by the national mission on education through ict, mhrd, government of india more information on this mission is available at

http://spoken-tutorial.org/nmeict- intro the library management system has been contributed by a leading software mnc, through their corporate social responsibility program. they have also validated the content for this spoken tutorial. this is arya ratish from iit bombay signing off.thank you for joining.

Top 2 Online Photo Editor on The Internet

Tidak ada komentar:

Posting Komentar