The problem is when I upload the files of the project to my website (hosted at LunarPages, which supports servlets and jsp's), I get a 404 error (page not found). I kept the directory structure exactly the way I had it in my hard-drive:
There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
If I understand what you mean - then yes i'm sure. For example: If I put an index.html under public_html then this is the page that is displayed when accessing the site
But it looks like the site is set up as a web server (ie serving static content) not an application server (serving dynamic content). A quick way to check would be to request WEB-INF/web.xml and see if you get anything back. A Web server will return it, an application server protects this directory and will not.