How to Create java Web application using NetBeans IDE | Install Configure Tomcat 10 Server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] welcome to simplifying Tech and programming so in today's session we are going to check how we can create a web project by using apach nbin ID and how we can deploy that web application into Tomcat application server or the MAV and antb project so let's see the agenda first like what we are going to cover so first first we will download and install Tomcat server that is a latest version of Tomcat that is 10.1 then we will configure the web project into net bin and then we will create one M based web application we will create one solet and we will try to deploy that Ser into tomcat and try to run that web application so we will try another format of application or another build type of application web application that is a ant-based web application and then we will run to the browser so let's get started so go to our favorite browser and uh download and install Tomcat server so we have to go to this Tomcat 10 application server so we can see there is a tomcat 11 is also available but that is a Alpha version so we'll go with the Tomcat 10 only so the latest version is a tomcat 1 sorry 10.1.3 okay so uh you can observe one thing here like uh in the latest version of Tomcat so Tomcat is migrated from the API so javax doar to Jakarta start so this thing we we have to keep in mind so while developing the our solet or web application we have to use this package Jakarta Dost okay so here you can see lots of distribution files uh so Tomcat is available to install into Z format also but it is available as a Windows service installer also in today's demo we will going with this uh so we will install the windows service installer so let's go to this download folder so this Tomcat 10 1.13 is downloaded let's double click on this to install so this window popups let's say next say I agree so you can check mark this host manager and uh we will see some examples also that is also we need in order to debug our applications so here you can see Server shutdown Port that is a minus one this is the main port connector P that is 8080 Windows service name we will keep as a default then uh we need to provide the username and password in order to troubleshoot our application in the net bein so you have to provide any username and password and let's say next please select the path of the Java 11 or higher so in my case I'm going to continue with the uh G 1.8 version so it's automatically picked up Java version let's say next so it is asking for a path of installation so choose any any comfortable installation directory so in my case I'm choosing this uh tools and inside this folder Tomcat 10.1 let's say Okay okay so see do Tomcat 10.1 and let's install Okay so Tomcat setup is completed so run Apache Tomcat let's say finish so it is running Apache Tomcat okay so our Tomcat is install so now uh we will create one web application and we will configure that application into Tom Cat application server okay so let's go to net beans so we are using this uh ID that is apach net beans ID so this is the basic ID so just we have to go to file and say new project here we want to create the web application so first we will try with the MAV so Java with MAV option is there category is there inside that there are different types of projects are there so we have to create the web application okay so click on this web application say next so now it is asking for a project so Maven project we will see so here we can give Maven web project then group ID as a com Doc and then M project so this is fine so let's say next so now it is asking to select the server so in our case there is a no server so we need to add this server so click on this add now we have to choose this Tom Cat Apache okay say next then choose the server location go here and uh give the Tom Cat installation path so that is uh we have chose c2s and 10 okay let's say open so here it is saying that the specified server location folder does not valid so we have to go to this directory and check what is happening so go to tools and go to Tom cat oh so it is saying the you don't have the permission to access this folder so so you have to give the permission so what we have to do go to properties and it is a read only so remove this read only and say okay okay so now select this again now you can see the folder structure click on okay so now uh Ser server location is fine now so just give the username and password that we have provided at the time of installation and let's finish so now the server and uh Pat version so Jakarta 10 version is there so let's say finish again okay so this is the uh web application it is created this is the my one project so what is the structure of this project so first of all this project file that is a build configuration file that is a pom.xml and then we have web pages here we have index.html here we have have web.xml inside the web INF and here we have source files here we have dependencies that are loaded and uh Java dependency other sources this is fine okay so pom.xml by default it it has added the dependencies so now we have to create one solid in order to create the web application we need to create one solet so here you can see the option as a solet like uh if you're not able to see here then go to other and uh here you can see there is a solid option so then next so it is asking to create new solet so type as a hello subet okay let's say next so add the information into deployment descriptor so we need to mention this into web.xml that is what is the URL pattern and what is the Sol name okay so check mark this let's say finish okay so it is a created hello solet and uh it has created some uh method also that is a process request method inside the hello subet let me Zoom the font okay so we have increase the fonts Let's uh maximize this so you can see there there are some errors what are that errors package javax HTTP solid does not exist so why it is does not exist so that I mentioned in the earlier video so if you can see this uh latest version of tom cat has a javx package moves to Jakarta package so we just need to copy this Jakarta package and replace the javx with Jakarta okay and that's it so this solate do solate exception and whatever the solate packages are there that is like belongs to Jakarta now in latest so let's save this just we can add add here solet hello solet and here solet hello solet so here we will write the channel name okay so simplifying Tech hello solet at uh this uh context path so this is just we are printing the printing something onto UI so let's save this okay so now let's run this project so right click on project and let's say run so it is started running so it is ask asking for username and password for Tomcat so provide the username and password let's say okay so now you can observe one thing uh so our application is running so start method is called and our Tomcat is running on port 8080 so now let's verify this go to Services go to servers uh go to Apache tomcat and here you can see the web application directory is created and you can see this m web project so our this is our web project so that web project now is a part of Tomcat server okay so Tomcat is now hosting our project so now let's run the seret file okay so go look at this hello solet and here you can see this text so right click on this hello solet and say run file so it is asking for context rout let say Okay okay so it is saying that simplifying create hell Sol M project okay so this text we have copied from here this simplifying Tech hello salet at request.get context path so this is the project name that is a context path so this text like by using this so we can able to run this project into browser okay so by using me so we can able to run this web application so you can observe this context route so that is a local 8 Maven web project and then hello solet so this hell solet is nothing but a URL pattern into our web.xml so you can see see this is a URL pattern as a hello Sol so this can be used while running your application okay so now same way we can create another type of project so that is a and project and we can try to run the web application from and project as well so go here and choose the category as a Java with and so now uh inside this Java with and you can see there are more options so go to Java web and you here we can see web application so click on this web application let's say next and here it is saying so we have to say ant web application and let's say next so here it is asking uh we have already selected This Server as a tomcat now ant we application let's say next and here it is asking for framework so we are not using any of these framework uh we are using just we are running just simple web project so let's say finish we are not selecting anything okay so here this is the ant web application let's close the previous project okay so this is the ant web application so here there are like the structure of the project is like this web pages then web and uh here there are Source packages here we can write the solet and here there is a configuration file so just we have to create the solet file so go to Source packages and let's say new and here you can see option solet so here you have to choose the class name we will keep same as it is new solet and just say next here you can see uh there is option add information into deployment descriptor descriptor so just click on this and say finish okay so now you can see uh the subet is created as a new sulet but you can see there is a error so so here like I mentioned earlier so we have to replace javax with Jakarta because new Tom cat version is supporting Jakarta only fine so our error now is no longer remaining so just here just type as a simplifying Tech and that's it so just we have to click on this uh new solet application and uh we have to say run file let say Okay okay so here you can see the browser is loaded with our Maven sorry our ant based uh web page that that is take ant project for the solet and antwa application yeah so here this is the antwa application and here this message we have provided here simplifying Tech and project okay so this way we can uh create the web application by using uh netb ID and by using uh and and type of uh build projects so stay tuned for further interesting sessions and thanks a lot for watching
Info
Channel: Simplifying Tech
Views: 2,740
Rating: undefined out of 5
Keywords: java, apache netbeans, netbeans ide, how to create java web project in netbeans, how to create java website, how to create java web application, netbeans java web project, java web netbeans 18, how to create servlet in netbeans, how to create servlet in java, configure tomcat with nebeans, configure tomcat with netbeans, servlet and jsp tutorial, servlets in java, servlet using netbeans, create servlet in netbeans, servlet in netbeans, how to add server in netbeans, servlet
Id: gqyB0ef4duY
Channel Id: undefined
Length: 13min 16sec (796 seconds)
Published: Sat Sep 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.