📄 servletutilities.html
字号:
SPECIAL NOTE: Please avoid using JPEG as an image format for charts, it is a "lossy" format that introduces visible distortions in the resulting image - use PNG instead. In addition, note that JPEG output is supported by JFreeChart only for JRE 1.4.2 or later.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>chart</CODE> - the JFreeChart to be saved.<DD><CODE>width</CODE> - the width of the chart.<DD><CODE>height</CODE> - the height of the chart.<DD><CODE>session</CODE> - the HttpSession of the client (if <code>null</code>, the temporary file is marked as "one-time" and deleted by the <A HREF="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><CODE>DisplayChart</CODE></A> servlet right after it is streamed to the client).<DT><B>Returns:</B><DD>The filename of the chart saved in the temporary directory.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if there is a problem saving the file.</DL></DD></DL><HR><A NAME="saveChartAsJPEG(org.jfree.chart.JFreeChart, int, int, org.jfree.chart.ChartRenderingInfo, javax.servlet.http.HttpSession)"><!-- --></A><H3>saveChartAsJPEG</H3><PRE>public static java.lang.String <A HREF="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.247"><B>saveChartAsJPEG</B></A>(<A HREF="../../../../org/jfree/chart/JFreeChart.html" title="class in org.jfree.chart">JFreeChart</A> chart, int width, int height, <A HREF="../../../../org/jfree/chart/ChartRenderingInfo.html" title="class in org.jfree.chart">ChartRenderingInfo</A> info, javax.servlet.http.HttpSession session) throws java.io.IOException</PRE><DL><DD>Saves the chart as a JPEG format file in the temporary directory and populates the <code>ChartRenderingInfo</code> object which can be used to generate an HTML image map. <p> SPECIAL NOTE: Please avoid using JPEG as an image format for charts, it is a "lossy" format that introduces visible distortions in the resulting image - use PNG instead. In addition, note that JPEG output is supported by JFreeChart only for JRE 1.4.2 or later.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>chart</CODE> - the chart to be saved (<code>null</code> not permitted).<DD><CODE>width</CODE> - the width of the chart<DD><CODE>height</CODE> - the height of the chart<DD><CODE>info</CODE> - the ChartRenderingInfo object to be populated<DD><CODE>session</CODE> - the HttpSession of the client (if <code>null</code>, the temporary file is marked as "one-time" and deleted by the <A HREF="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><CODE>DisplayChart</CODE></A> servlet right after it is streamed to the client).<DT><B>Returns:</B><DD>The filename of the chart saved in the temporary directory<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if there is a problem saving the file.</DL></DD></DL><HR><A NAME="createTempDir()"><!-- --></A><H3>createTempDir</H3><PRE>protected static void <A HREF="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.279"><B>createTempDir</B></A>()</PRE><DL><DD>Creates the temporary directory if it does not exist. Throws a <code>RuntimeException</code> if the temporary directory is <code>null</code>. Uses the system property <code>java.io.tmpdir</code> as the temporary directory. This sounds like a strange thing to do but my temporary directory was not created on my default Tomcat 4.0.3 installation. Could save some questions on the forum if it is created when not present.<P><DD><DL></DL></DD></DL><HR><A NAME="registerChartForDeletion(java.io.File, javax.servlet.http.HttpSession)"><!-- --></A><H3>registerChartForDeletion</H3><PRE>protected static void <A HREF="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.301"><B>registerChartForDeletion</B></A>(java.io.File tempFile, javax.servlet.http.HttpSession session)</PRE><DL><DD>Adds a <A HREF="../../../../org/jfree/chart/servlet/ChartDeleter.html" title="class in org.jfree.chart.servlet"><CODE>ChartDeleter</CODE></A> object to the session object with the name <code>JFreeChart_Deleter</code> if there is not already one bound to the session and adds the filename to the list of charts to be deleted.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>tempFile</CODE> - the file to be deleted.<DD><CODE>session</CODE> - the HTTP session of the client.</DL></DD></DL><HR><A NAME="sendTempFile(java.lang.String, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>sendTempFile</H3><PRE>public static void <A HREF="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.328"><B>sendTempFile</B></A>(java.lang.String filename, javax.servlet.http.HttpServletResponse response) throws java.io.IOException</PRE><DL><DD>Binary streams the specified file in the temporary directory to the HTTP response in 1KB chunks.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>filename</CODE> - the name of the file in the temporary directory.<DD><CODE>response</CODE> - the HTTP response object.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if there is an I/O problem.</DL></DD></DL><HR><A NAME="sendTempFile(java.io.File, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>sendTempFile</H3><PRE>public static void <A HREF="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.343"><B>sendTempFile</B></A>(java.io.File file, javax.servlet.http.HttpServletResponse response) throws java.io.IOException</PRE><DL><DD>Binary streams the specified file to the HTTP response in 1KB chunks.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the file to be streamed.<DD><CODE>response</CODE> - the HTTP response object.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if there is an I/O problem.</DL></DD></DL><HR><A NAME="sendTempFile(java.io.File, javax.servlet.http.HttpServletResponse, java.lang.String)"><!-- --></A><H3>sendTempFile</H3><PRE>public static void <A HREF="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.370"><B>sendTempFile</B></A>(java.io.File file, javax.servlet.http.HttpServletResponse response, java.lang.String mimeType) throws java.io.IOException</PRE><DL><DD>Binary streams the specified file to the HTTP response in 1KB chunks.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the file to be streamed.<DD><CODE>response</CODE> - the HTTP response object.<DD><CODE>mimeType</CODE> - the mime type of the file, null allowed.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if there is an I/O problem.</DL></DD></DL><HR><A NAME="searchReplace(java.lang.String, java.lang.String, java.lang.String)"><!-- --></A><H3>searchReplace</H3><PRE>public static java.lang.String <A HREF="../../../../src-html/org/jfree/chart/servlet/ServletUtilities.html#line.421"><B>searchReplace</B></A>(java.lang.String inputString, java.lang.String searchString, java.lang.String replaceString)</PRE><DL><DD>Perform a search/replace operation on a String There are String methods to do this since (JDK 1.4)<P><DD><DL><DT><B>Parameters:</B><DD><CODE>inputString</CODE> - the String to have the search/replace operation.<DD><CODE>searchString</CODE> - the search String.<DD><CODE>replaceString</CODE> - the replace String.<DT><B>Returns:</B><DD>The String with the replacements made.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/ServletUtilities.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/jfree/chart/servlet/DisplayChart.html" title="class in org.jfree.chart.servlet"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/jfree/chart/servlet/ServletUtilities.html" target="_top"><B>FRAMES</B></A> <A HREF="ServletUtilities.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -