I just started servlet/jsp tutorial from yesterday.
I followed the tutorial, but unlike tutorial my code doesn't work.
my system is MacOS. I am going to explain my issues with attached picture so that you guys can help me to figure the issues out.
Below is my folder structure. I added class file(firstServelt.class -sorry I mistyped) into classes folder which is just simply System.out.println("Hello") in service method.
Then, below is web.xml file. I added servlet and servlet-mapping there.
The thing that is weird for me is that when I run server without adding and , which is default initial web.xml, localhost:8080 gives me tomcat page as below.
However, after servlet and servlet-mapping for firstServelt.class, it gives me 404 NOTFOUND pages for "Localhost:8080" as well as "Localhost:8080/hello".
I am supposed that both "Localhost:8080" and "Localhost:8080/hello" should work. (I know the Localhost:8080/hello will give me blank page by printing "hello" into console. but it just give me non found pages). I am really struggling with finding issues. I want to go step further with my tutorial but due to this issue, I am stuck here.
It would be so thankful if anyone help me to fix the issue!
PS. one more question, I don't know why but whenever I stop my tomcat server from terminal, it doesn't stop as background process. so every single time, when I re-run tomcat server, I have to find $ps -ax |grep tomcat then $kill -9 pID. is there any way that this process can be terminated when I just exit from terminal?
Thank you for reading my dumb questions.
Let me know if you need to know other part of code. !