String target = "pages/common/Error.jsp"; request.setAttribute( "error", e ); RequestDispatcher rd = request .getRequestDispatcher( target ); rd.include( request, response );
displayException( request, response, e );
	public void doPost( HttpServletRequest request, HttpServletResponse response )			throws ServletException, IOException	{		String requestType = request				.getHeader( ParameterAccessor.HEADER_REQUEST_TYPE );		if ( ParameterAccessor.HEADER_REQUEST_TYPE_SOAP				.equalsIgnoreCase( requestType ) )		{			ReportEngineService.getInstance( ).setEngineContext(					getServletContext( ), request );			BirtContext context = new BirtContext( request );			if ( "/download".equalsIgnoreCase( request.getServletPath( ) ) ) //$NON-NLS-1$			{				if ( context.getBean( ).getException( ) != null )				{					context.finalize( );					String target = "pages/common/Error.jsp"; //$NON-NLS-1$					request.setAttribute(							"error", context.getBean( ).getException( ) ); //$NON-NLS-1$					RequestDispatcher rd = request							.getRequestDispatcher( target );					rd.include( request, response );				}				else				{					try					{						engine.service( request, response );					}					catch ( BirtException e )					{						String target = "pages/common/Error.jsp"; //$NON-NLS-1$						request.setAttribute( "error", e ); //$NON-NLS-1$						RequestDispatcher rd = request								.getRequestDispatcher( target );						rd.include( request, response );					}					finally					{						context.finalize( );					}				}			}			else			{				super.doPost( request, response );				context.finalize( );			}		}		else		{			doGet( request, response );		}	}