GeeCON Prague 2014*
The moose likes Servlets and the fly likes Servlet Not Found 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Not Found 404" Watch "Servlet Not Found 404" New topic
Author

Servlet Not Found 404

Nauman Khan
Ranch Hand

Joined: Aug 07, 2003
Posts: 49
Hi All,
I have created a folder nauman and placed two files index.html and NKServlet.class with NKServlet.java in this way
c:\tomcat4.1\webapps\nauman\index.html
c:\tomcat4.1\webapps\nauman\WEB-INF\classes\NKServlet.class
c:\tomcat4.1\webapps\nauman\WEB-INF\classes\NKServlet.java
c:\tomcat4.1\webapps\nauman\WEB-INF\web.xml
and I wrote web.xml
<web-app>
<servlet>
<servlet-name>NKServlet</servlet-name>
<servlet-class>NKServlet</servlet-class>
</servlet>
</web-app>
When i run the http://localhost:8080/nauman/index.html, it works fine but when i click the submit button which takes me to Servlet, It doesn't work,
It says 404 NKServlet not found. I tried to run with different way but it doesn't work
code of index.html is
<form name="Newfrm" action="servlet/NKServlet" method="POST">
<input type=submit value="submit">
</form>
I did this with href to use get method but It doesn't work.
Please help me to find where I'm making mistakes to run the servlet.
Thanks in Advance,
Nauman


Nauman Khan <br />SCJP,MCSE,SCWCD,SCBCD,SCWCD1.4
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61306
    
  66

Howdy Nauman, welcome to the Ranch!
One rule you are problably not aware of is that it is considered a no-no to post the same question multiple forums.
Please pick the one forum which you think is most appropriate for your question. And don't worry, if you get it wrong, the friendly neighborhood bartender will move your post to the appropriate forum.
thanks,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61306
    
  66

OK, two rules: your display name doesn't match the naming policy. The Servlet bartend will probably be hitting you up to change it, so why not be a pal and take a look at the JavaRanch Naming Policy and change your display name to match it.
thanks again,
bear
Nauman Khan
Ranch Hand

Joined: Aug 07, 2003
Posts: 49
Thanks for update me.But the reason to post this room is because I didn't get the response of my question that's why I posted here.
I will also have a look of JavaRanch Policy.
Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61306
    
  66

Hi Nauman, regardless of your reason, cross-posting is discouraged. By the way, you waited exactly one hour before cross-posting. Do you really expect instantaneous responses?
bear
P.S. Thanks for adjusting your name as per policy!
[ September 17, 2003: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Not Found 404