Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in servlet due to reasons unknown

 
yuvraj kotegar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is my html code
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


this is my web.xml
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then i have a SendRedirect and ValidUser classes compiled in the classes folder.

however when i open the front end html and try to access i get 404 error. even though i have the compiled class. is there any problem with web.xml or form action path in html??
 
rakesh sugirtharaj
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this - instead of

use
(without backslash in action)
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<servlet-class>SendRedirect</servlet-class>


ALL classes used in servlets should be in packages. Without a package, the JVM looks in the "current" directory - which you have no control over. On failure to find the class you get an error.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic