aspose file tools*
The moose likes Servlets and the fly likes To stop JSP Processing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "To stop JSP Processing" Watch "To stop JSP Processing" New topic
Author

To stop JSP Processing

Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
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).]


<b>Sandeep</b> <br /> <br /><b>Sun Certified Programmer for Java 2 Platform</b><br /> <br /><b>Oracle Certified Solution Developer - JDeveloper</b><br /><b>-- Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java </b><br /><b>-- Object-Oriented Analysis and Design with UML</b><br /> <br /><b>Oracle Certified Enterprise Developer - Oracle Internet Platform</b><br /><b>-- Enterprise Connectivity with J2EE </b><br /><b>-- Enterprise Development on the Oracle Internet Platform </b>
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
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


Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12805
    
    5
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

Joined: Oct 12, 2000
Posts: 124
<% return; %> this should stop the processing of service method.
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: To stop JSP Processing