A small nitpick: the compiler will complain that code below the "return" is unreachable. You can trick the compiler (in a compiler-independent way) by saying "... if(true)return;..."
Also, this type of situation is common enough that custom tags in JSP1.1 can indicate that the action is completed. This is done via the doEndTag() method. In particular this means you could write a trivial <x:responseEnd/> custom tag in JSP 1.1.
Hope this helps,
- eduard/o
Date: Mon, 30 Aug 1999 12:01:23 -0700 From: "Craig R. McClanahan" Subject: Re: Response.EndMichael Fuhrman wrote: > Hello All, > > Simple question .. In asp, there's a response.end .. which terminates the > activity of the ASP page. Is there an equivalent, or do I just EXIT (0); > > Hoping there's a cleaner way! > By default, you don't need to do anything at all. At the end of your JSP page, the generated code flushes the output stream for you, and gets ready for the next request. If you want to terminate the output at a particular point, the simplest way would be with a Java Scriptlet like this: <% out.flush(); return; %> This works because your JSP page is encapsulated in the service() method of a Java Servlet created by the JSP page compiler, and you can return from a method any time you want. The "flush" call ensures that any previously generated output (i.e. the contents of your page up to this point) are actually sent back to the browser. > > Michael J. Fuhrman > Reliable Business Computers > http://www.creliable.com > Craig McClanahan
