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

Calling Servlet from a java class

 
Neha Sharma
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
Hi guys how can I call a servelet in java class when some method in that class finds an exception.
Thank
Neha
 
Prasanna KumarBP
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
write same code, what u do for applets :-)
-Prasanna
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean "can you somehow invoke the service() or doPost()" method to display the results of the error -- the answer is no, you can't do that. You'll have to bubble the exception up to the servlet that originally was called and handle it there.
I think you might have a more interesting question here. Is your question really "how do I handle exceptions in Servlet programming and display errors properly?"
Kyle Brown
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic