How to Create Java Web Project in NetBeans

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Learn how to develop a basic Java web project using Apache NetBeans from scratch for beginners, with the following details:
    - Create Java Web project with Maven
    - Download & install Apache Tomcat server
    - Create Java Servlet & JavaServer Page (JSP)
    - Run Java Web App on Tomcat inside NetBeans
    - Deploy Java Web App on Tomcat outside NetBeans

Komentáře • 116

  • @Hannah-oj1ts
    @Hannah-oj1ts Před 2 lety +10

    Thanks for making this! Very clearly explained
    As of November 2021, Apache Tomcat v.10 doesn't play nice with Java EE 7. Save yourself a headache, use v.9 like is recommended in the video :D

    • @CodeJava
      @CodeJava  Před 2 lety +1

      Glad it helped! And thanks for your update about Tomcat 10.

  • @kirubakaran5161
    @kirubakaran5161 Před 3 lety +5

    Precisely demonstrated the concepts. Helped a lot to learn the Netbeans IDE and Web app development. thank you

    • @CodeJava
      @CodeJava  Před 3 lety +1

      You're welcome. Glad it helped.

  •  Před 2 lety +1

    hi do you know how to solve this
    The requested resource [/unitConverter/convert] is not available
    I always get this message

    • @CodeJava
      @CodeJava  Před 2 lety

      Is that 404 error? If so, check URL mapping of the servlet - be sure no typos.

    •  Před 2 lety

      @@CodeJava yes 404 error. Already checked it multiple times 😢

  • @nguyenducduy9299
    @nguyenducduy9299 Před 3 lety +5

    Nghe giọng biết ngay người Việt !
    Thanks for this.

    • @CodeJava
      @CodeJava  Před 3 lety +2

      you're welcome :)

    • @sal-so2rw
      @sal-so2rw Před 6 měsíci

      Thought he was french😅😅😅😅😅

  • @ibtisamali2329
    @ibtisamali2329 Před rokem +5

    Thank you for your videos. It helped me a lot. But, I'm using IDE 15, and Java 18.0.2. I was trying to follow along with you starting with the simple web Maven application, but it fails and do not run. It gives me this error: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1 I tried to find a solution, but nothing is working. I'm not sure what I need to do to resolve it. Would you please advise me.

    • @CodeJava
      @CodeJava  Před rokem

      can you share the full error?

  • @bincyelizabeth19799
    @bincyelizabeth19799 Před 7 měsíci

    watching from Kerala,India

    • @CodeJava
      @CodeJava  Před 7 měsíci

      Got it. Thanks for watching :)

  • @devanshbhuptani260
    @devanshbhuptani260 Před 3 lety +7

    Hey, when I'm doing clean and build, it's showing an error:
    Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project Prac3: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.3:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.3' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
    Can you help me with this, please?

  • @lolicon5x10
    @lolicon5x10 Před rokem +1

    Hey, i got a error. It said "FAIL - Failed to deploy application at context path [/WebApplication1]
    C:\Users\Admin\Documents\NetBeansProjects\WebApplication1
    bproject\build-impl.xml:1030: The module has not been deployed." Can you help me fix it ?

    • @CodeJava
      @CodeJava  Před rokem +1

      I have no idea why.

    • @darthalzmaul
      @darthalzmaul Před 10 měsíci

      i got the same error, its most likely connected to incompatible versions.
      I use jdk-21 tomcat 9 and selected java-EE 8, ill try to re-do this with the exact versions from the tutorial and then see if it works

    • @omkarkambire6965
      @omkarkambire6965 Před 10 měsíci

      @@darthalzmaul have you tried?

    • @darthalzmaul
      @darthalzmaul Před 10 měsíci

      @@omkarkambire6965 I have not tried. As far as I remember I fixed it somehow but ran into a lot more problems afterwards, I switched to vs code and springboot web which worked a lot better.

  • @user-sf7qi7xz6s
    @user-sf7qi7xz6s Před rokem

    It works. And I understand, how does it work. Thannk you!

  • @anggaluri8492
    @anggaluri8492 Před 2 lety +1

    Thanks for Tutorial, thats is helpfull

  • @james10master
    @james10master Před 3 lety +1

    When I'm trying to run the application at around 8:15, the build is successful but I get this error message at the top:
    FAIL - Failed to deploy application at context path [/webApp]

    • @james10master
      @james10master Před 3 lety

      Nevermind, I fixed the issue. I had two instances of TomCat running at once

    • @devanshbhuptani260
      @devanshbhuptani260 Před 3 lety

      Hey, do you know how to create Servlets in this?

  • @alvinkariuki236
    @alvinkariuki236 Před 3 lety +1

    thanks for this superb run through

  • @onwunandu
    @onwunandu Před 3 lety +1

    i get an error 404 when i enter a value and click the button to convert. how do i fix this

    • @CodeJava
      @CodeJava  Před 3 lety +1

      check servlet URL mapping - it should match the action of the form. Also refer to this video for solution: czcams.com/video/t7VuQBHXXrM/video.html

    • @onwunandu
      @onwunandu Před 3 lety

      ive solved it.. thanks

    • @pluto7367
      @pluto7367 Před 2 lety

      how did you resolve?

  • @drashtipatel9462
    @drashtipatel9462 Před 2 lety +1

    Thank you so much for this video 🤗🤗

  • @amnojeeuw
    @amnojeeuw Před rokem

    Hi there, can anyone recommend a tutorial like this one in American English?

  • @qosku
    @qosku Před 3 lety

    ERROR Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project mavenproject1: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.3:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.3' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null

    • @CodeJava
      @CodeJava  Před 3 lety

      Hmm... I have no idea why.

    • @fer8091
      @fer8091 Před 2 lety

      Did you fixed it? I have the same problem but don't know how to deal ;(

    • @qosku
      @qosku Před 2 lety

      @@fer8091 Yes , unistall all and intall (Reinstall all)

  • @andresparedeshorna2380
    @andresparedeshorna2380 Před 8 měsíci

    Thanks for the video, but Legends would help me a lot,

    • @CodeJava
      @CodeJava  Před 8 měsíci

      No problem 👍 you mean the captions or suggested chapters?

    • @andresparedeshorna2380
      @andresparedeshorna2380 Před 8 měsíci

      I mean to enable "Subtitles/Close Captions" in English. Thanks very much.

  • @rypper888
    @rypper888 Před 8 měsíci

    Thank u for teaching

  • @syedmmhm1857
    @syedmmhm1857 Před 2 lety +1

    Thanks very much 💘

  • @diemquyentran7729
    @diemquyentran7729 Před rokem

    I have an error here: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:war (default-war) on project LAB_WEB: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.3:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.3' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: null
    Please help :((

  • @Jrj4250
    @Jrj4250 Před rokem

    At around 22:22 RequestDispatcher is mentioned but its not defined anywhere in the code and mine throws the "cannot find symbol" error at me, why is this?

    • @Jrj4250
      @Jrj4250 Před rokem

      Edit: I could not get RequestDispatcher so I got rid of that and just ran that line (request.getRequestDispatcher(resultPage)) and did the .forward to that

    • @CodeJava
      @CodeJava  Před rokem

      you mean the problem was solved?

    • @Jrj4250
      @Jrj4250 Před rokem

      I suppose it could be interpreted that way. I would say I solved it. I just jumped around the problem and made it work for just my case. Guess I could've said I solved it too.

  • @nallathambi431
    @nallathambi431 Před 3 lety +1

    Hi ,Very well nice ! thank ..

  • @thomasturner8093
    @thomasturner8093 Před 2 lety

    Why did *Jakarta EE 8 WEB* disappear after you installed _Tomcat 9_ ?

  • @vanajakarthika7900
    @vanajakarthika7900 Před 2 lety

    hi am not getting the result printed...simply shows$(miles)=$(km)=kilometres

  • @maduabewardana7900
    @maduabewardana7900 Před 2 lety +1

    Thank you so much

  • @deusexeugenics
    @deusexeugenics Před 11 měsíci

    How can i make a java aplication execute with the web services?

    • @CodeJava
      @CodeJava  Před 11 měsíci

      you need to run your java app in a web server like Apache Tomcat. Check this video: czcams.com/video/N1UzS9ojuUY/video.html

    • @deusexeugenics
      @deusexeugenics Před 11 měsíci

      @@CodeJava glassfish is useful for this task to?

    • @CodeJava
      @CodeJava  Před 11 měsíci +1

      yes, but GlassFish is heavier than Tomcat@@deusexeugenics

  • @sachinsharma1230
    @sachinsharma1230 Před 3 lety +1

    Thank you soo much ❤❤❤❤❤❤❤❤❤❤❤❤🙌🙌🙌🙌🙌🙌🙌

  • @ron_fut_aldo5622
    @ron_fut_aldo5622 Před 2 lety

    Nice video 🥰

  • @nahlakechroud4010
    @nahlakechroud4010 Před 3 lety

    it takes too long to run the project
    and what's the différence between create java project with Maven and java with Ant and choose java web / java web application ?

    • @CodeJava
      @CodeJava  Před 3 lety +3

      Maven and Ant are two different software project management and build tools.

    • @nahlakechroud4010
      @nahlakechroud4010 Před 3 lety +2

      @@CodeJava please when i run the project, an error message : Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project : Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.1.1' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties.
      i googled and i tried all solutions but the same error. this is the first time i work with netbeans and maven project

    • @romualdmbogne3866
      @romualdmbogne3866 Před 2 lety +1

      @@nahlakechroud4010 change maven-war-plugin version from 2.1.1 to 3.2.2, it works for me

  • @muhammadraza2895
    @muhammadraza2895 Před 2 lety

    Hi,code java
    when i am creating this and run my project file running sucessfully but when creating servlet and hit to convert button this show me http status 404 UnitConverter/Convert not found i think servlet not found how can i remove this errror plz guide thanks u

    • @CodeJava
      @CodeJava  Před 2 lety

      Check typos in action URL of the form, it should be action="convert"

    • @muhammadraza2895
      @muhammadraza2895 Před 2 lety

      @@CodeJava action="convert" i can follow your turtorial but still http 404

    • @muhammadraza2895
      @muhammadraza2895 Před 2 lety

      @@ayeshaazad5872 then how you can solve this error ???

    • @muhammadraza2895
      @muhammadraza2895 Před 2 lety

      @@ayeshaazad5872 hence prove LHS=RHS😂

    • @muhammadraza2895
      @muhammadraza2895 Před 2 lety

      @@ayeshaazad5872 which university and
      Smester?

  • @adamchilds9132
    @adamchilds9132 Před 3 lety

    Hi when I run the code after creating the servlet class I get this error
    COMPILATION ERROR :
    -------------------------------------------------------------
    error: Source option 6 is no longer supported. Use 7 or later.
    error: Target option 6 is no longer supported. Use 7 or later.
    Any ideas how I can solve this thank you great video :-)

    • @CodeJava
      @CodeJava  Před 3 lety

      That means Java version 1.6 is no longer supported. You must configure the java compiler version to 1.7 or newer in the project properties dialog (press F4).

  • @thendophungotshiendanamisi68

    When i put in the numbers it says HTTP status 404 - not found

    • @CodeJava
      @CodeJava  Před 2 lety

      check the URLs specified in the action attribute of the form, for links. Also check suggested solutions in this video: czcams.com/video/t7VuQBHXXrM/video.html

  • @modris2980
    @modris2980 Před rokem

    Thank you.

  • @devanshbhuptani260
    @devanshbhuptani260 Před 3 lety +2

    Hey, thanks for this, but can you show me how to create Servlets in this?

    • @CodeJava
      @CodeJava  Před 3 lety +2

      kindly watch from the minute 12:36

    • @devanshbhuptani260
      @devanshbhuptani260 Před 3 lety +2

      @@CodeJava, I followed each and every step you've mentioned in the video, but still it's not working

  • @shubhamverma865
    @shubhamverma865 Před 2 lety

    Sir how to add jar file

    • @CodeJava
      @CodeJava  Před 2 lety

      Right-click on the project name in the Projects tab.
      Select Properties.
      Select Libraries.
      Click the Add Jar/Folder button.

  • @hc38
    @hc38 Před 2 lety +1

    Tks bác :v

  • @lengocthang7139
    @lengocthang7139 Před 2 lety

    giọng anh này giống ng việt ghê

  • @huyvu5439
    @huyvu5439 Před 2 lety

    Tiếng anh dễ nghe khả năng cao là người việt =)))

    • @CodeJava
      @CodeJava  Před 2 lety +1

      đúng rồi đó bạn.

  • @Faza_H
    @Faza_H Před rokem +2

    really nice video but would have helped a lot if there were time lapse.