• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Servlet Error

 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to all,

I m trying to connect my html to servlet it is giving 404 error i gave correct url only but why it is not connecting to my servlet .This is my html form.Please can anybody check this one..

Thanks,


<html>
<head>
<title> Wel Come </title>
</head>
<body bgcolor=lightblue>
<form action="/abc" method="GET" >
<h1><center><font color= "red">Home</center></h1>
<table align="center">
Username<input type="text" name="uname"><br><br>
<input type="submit" value="welcome">
</table>
</form>
</body>
</html>
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<form action="/abc" method="GET" >

What URL mapping are you using for your servlet?
Is your application the root context for your app server?
If not what is your contextPath (what is the name of your webapp)?
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,
I gave my classpath in action but it is not working again it is showing same error.

Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I asked you 3 questions; none of them about classpaths.
Nobody will be able to help you with your problem if you can't (or are unwilling to) tell us the details of what you've done.
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,

I am using document mapping Yes my application is in context root,i am using tomcat server.

Thanks,
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vishnu vardhan:
I am using document mapping



Is it going to take dynamite to get you to show us the mapping?
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vishnu,

As Bear asks, please provide us with the web.xml file that you use for your application and we will be able to help you better!
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ben,
sorry for tht one. This is my web.xml file
and thanks sanker.

<web-app>
<display-name>welcome to my servlet</display-name>
<servlet>
<servlet-name>aaa</servlet-name>
<servlet-class>Myexp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>aaa</servlet-name>
<url-pattern>/ main.html</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>main.html</welcome-file>
</welcome-file-list>
</web-app>

Thanks.
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ben,
I got result where the mistake is i gave some wrong URL.
Thanks for your response

Thanks.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Place ALL classes used in servlets or JSP in a package - you will avoid lots of hard to debug problems that way.
Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic