Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can request.getRequestDispatcher call a servlet?  RSS feed

 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I am trying to forward the request to a servlet SaveAction.java in the package inside src. i.e src/com/ctrdb/SavaAction.java.
This the code I am using


But it displays that the requested resource is not available.
What should I do to correct it.

Thanks
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not redirect to the source of the servlet but to the actual servlet itself, how you named it in your web.xml file.
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried that too.
I gave "/SaveAction" in web.xml and the full path there.

This did not work either.
Thanks
 
Campbell Ritchie
Sheriff
Posts: 55339
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a beginner's question. Moving.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That should have worked if the class file is in the right place. What happens when you try to access the servlet directly?

Originally posted by Sahana Hegde:
I tried that too.
I gave "/SaveAction" in web.xml and the full path there.

This did not work either.
Thanks
 
Sahana Hegde
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Extremely sorry guys. Typo in the web.xml file. Found out when I hit the servlet directly. Thanks Bosun. Thanks All.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!