HappyCoding icon indicating copy to clipboard operation
HappyCoding copied to clipboard

Example code files under "Anatomy of a Web App" don't run

Open qianzhong516 opened this issue 3 years ago • 3 comments

Hi, by following the tutorial Anatomy of a Web App, I have set up the exact same directory shown in the image below: image but accessing localhost:8080/HelloWorld/hello returns not-found error.

I've also tried downloading your code from here and copy-pasted it under my webapps directory, it didn't work either.

Please advise how to fix the issue, thanks :)

qianzhong516 avatar May 11 '22 12:05 qianzhong516

What happens if you visit localhost:8080/HelloWorld/index.html?

KevinWorkman avatar May 20 '22 02:05 KevinWorkman

It shows the index.html content, but nothing shows at localhost:8080/HelloWorld/hello.

qianzhong516 avatar May 21 '22 01:05 qianzhong516

My file structure: Screen Shot 2022-05-21 at 11 05 40 am

How I generate the .class file

javac -cp lib/servlet-api.jar <path-to-java-file>

qianzhong516 avatar May 21 '22 01:05 qianzhong516