<%@ page language="java" contentType="image/gif" import="java.awt.*,java.awt.image.*,java.io.*,java.util.*" %>

<html>
<head>
</head>
<jsp:useBean id="egpm" scope="session" class="EmissionGasProfileManager2"/>
<body>
<%
            int fuel = egpm.getFuelWC();
            String itemTitle = egpm.getItemTitleWC();
            //boolean success = egpm.makeEmissionChart(itemTitle);
boolean success = egpm.processForBarChart(fuel, itemTitle);
            if(success) {

                BufferedImage bi = egpm.getBufferedImage();

                if(bi != null) {

                    request.setAttribute("image",bi);

					RequestDispatcher rd = application.getRequestDispatcher("/dyn_img");			   				 						 

					if( rd != null)
                       rd.forward(request,response);
		            else
					    System.out.println(" rd is NULL"); 			
					System.out.println(" item title : " + itemTitle );
                } //

                else {
%>
					<p>Image is null</p>
<%
                    System.out.println("egpm.jsp, bi is null");
                } //
				
            } //if(success)
			
			else {
%>
					<p>No success</p>
<%
			}
%>
</body>
</html>