Can I stop JSP execution while in the midst of processing a request?
	
    
    Yes. Preemptive termination of request processing on an error condition is a good way to maximize the throughput of a high-volume JSP engine. The trick (asuming Java is your scripting language) is to use the return statement when you want to terminate further processing. For example, consider:<% if (request.getParameter("foo") != null) {// generate some html or update bean property} else {/* output some error message or provide redirection back to the input form after creating a memento bean updated with the 'valid' form elements that were input. This bean can now be used by the previous form to initialize the input elements that were valid then, return from the body of the _jspService() method to terminate further processing */return;}%>	
	
	
	
		
	
		
    
    
        
            
                - 
                Interview Candidate                        
-  Mar 25th, 2005
-  1
-  4193
 
     
     
	
    
          
              
            
              
                         
              
                    
              
              
     
    Showing Answers 1 - 1 of 1 Answers
			
				
				
       
       
		    
    
    
        
			
	
		
	
 
          
              
        
              
                      
              
                                   
  
                        
        Related Answered Questions
          
           
                              
            	
		Related Open Questions
		  
		   
	      
                       
  
                         
                    
            
Can I stop JSP execution while in the midst of processing a request?
Related Answered Questions
Related Open Questions