• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Problem: the requested resource is not available.  RSS feed

 
dheeraj lalwani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making one simple program to take few fields as input and then after clicking on confirm button confirm.jsp will appear.

I have created Controller.java servlet to identify the button clicked and then open the jsp.
Controller.java is stored in directory WEB-INF/classes/ch2/servletController and submit.jsp,register.jsp,confirm.jsp are stored in /ch2/servletController directory.

Whenever i click on confirm button, i get below error. WebApplication is the name of my project. I am using netBeans IDE.

HTTP Status 404 - /WebApplication/ch2/servletController/Controller

type Status report

message /WebApplication/ch2/servletController/Controller

description The requested resource is not available.

Please find below web.xml,servlet and all the jsp files..

1, register.jsp


2. confirm.jsp



3. submit.jsp




4. Controller.java





5. web.xml



6. index.jsp




I'd be grateful if anyone can help me to solve this problem.

Many Thanks in Advance.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you really using the URL
/WebApplication/ch2/servletController/Controller
??

For some reason the container does not think this is a valid application.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
action="Controller"

Page-relative addressing is fragile and should no be used. Always start URLs with the context path, whcih makes the server-relative and pretty much bullet-proof.
 
dheeraj lalwani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks friends for the valuable inputs.
This issue has been resolved. I had to change the path of register.jsp location to the web folder and it worked for me..

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!