Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

To stop JSP Processing

 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Since JSP operates on request/response mode, how do I stop the processing in the JSP?
I have tried the following without success.

The above code only prevents writing the response to the browser.Is it OK to use return or System.exit(0).What implication It might have on the JSP Engine?
Thanks in advance.
Regards,
Sandeep Desai
vgdesai@bom3.vsnl.net.in

  1. Sun Certified Java Programmer Scored 93 per cent
  2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
  4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56

  5. [This message has been edited by Desai Sandeep (edited April 27, 2001).]
 
Phil Hanna
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
return() is OK, but what do you expect to send back to a client? Are you sending some HTML before that so that they know what's happened?
I wouldn't use System.exit(), if your VM even allows it at all.
------------------
Phil Hanna
Sun Certified Programmer for the Java 2 Platform
Author of :
JSP: The Complete Reference
Instant Java Servlets
Website: http://www.philhanna.com
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could create a custom Exception and throw it, then have an errorPage that knows how to handle that exception type.
"Your query was just taking too long so I killed it - Nyah Nyah!"
Bill

------------------
author of:
 
Bhupinder Dhillon
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<% return; %> this should stop the processing of service method.
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
Thanks for the response.
As you have suggested, return() should do the trick, and a proper message should be sent to the client, so that they know what has happened (Thanks Phil)
Regards,
------------------
Sandeep Desai
vgdesai@bom3.vsnl.net.in

  1. Sun Certified Java Programmer Scored 93 per cent
  2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
  4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic