Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Error  RSS feed

 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • 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>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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,
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66200
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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?
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Hi ben,
I got result where the mistake is i gave some wrong URL.
Thanks for your response

Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!