Maintaining Browser Independence

Maintaining Browser Independence to Display Images or Use Client-Side Components

If you want Chart Fx for Java to detect the browser being used and return the appropriate <OBJECT> or <IMG> tags but without any files being generated as a result of this request, then you just include the getHtmlTag in your page and invoke the JSP that generates the chart and returns the BitStream using the getHtmlData method. For example, if you want to include a chart in a page that generates no temporary file but still detects the browser posting the request to send back a client-side component or image, use:


<%= Chart.GetHtmlTag(550,250,"#chart.jsp?Param=1") %>

Please note that the third parameter of the getHtmlTag has the following characteristics:

  • It starts with the # sign
  • The # sign is followed by the file that must invoked to generate the BitStream using the getHtmlData method
  • You can invoke, if necessary, the file with parameters (such as the Param shown in the getHTMLTag method above)

Then the chart.jsp looks like:


<%
ChartServer chart1 =
new ChartServer(application,request,response);
// Note the use of getHtmlData instead of getHtmlTag
chart1.getHTMLData("400","240","Auto");
%>

There must not be a space or carriage return before the start of the code.