File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes SOS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "SOS " Watch "SOS " New topic


Dhaval Patel

Joined: Jan 02, 2001
Posts: 7
Hi All,
I m new to servlets, I had installed jsdk2.1 as my webserver, i made a html file & a java program in the ..\examples\servlets\directory (which is my root directory)
I can access my servlet by http://localhost:8080/examples/servlet/s2
but i can't access the html file by writing http://localhost:8080/examples/servlet/form.html
Both the files are in same directory, eventhough it works for servlet but not for html files
Please help me to clear concept of working directory for servlets & also tell the way to access servlets in the sub directory eg. ..\examples\servlets\myjava\s3..
Appreciate yr support.
Dhaval Patel.
vikas sahni

Joined: Jan 01, 2001
Posts: 7
i have also used jsdk but the path ie required to invoke the servlet is http://localhost:8080/servlet/filename there is no need to write examples in between because servletrunner defaults the directory to examples as u can see when u run servletrunner.
u are not required to keep the html file in the same dir..
u can keep it anywhere and just pass the address of the servlet as above..that dir has somewhat different classloader may that would be creating some problem.
and if u want to place it in myjava dir, then place your servlet in package myjava
and call like this http://localhost:8080?servlet/myjava.s3
I agree. Here's the link:
subject: SOS
It's not a secret anymore!