锘??xml version="1.0" encoding="utf-8" standalone="yes"?>风间由美在线亚洲一区,噜噜综合亚洲AV中文无码,国产在亚洲线视频观看http://www.tkk7.com/yidishui/java 2006騫?鏈堟柊寮濮?)zh-cnSun, 11 May 2025 06:27:07 GMTSun, 11 May 2025 06:27:07 GMT60Struts 涓枃涔辯爜闂 Filter瑙e喅http://www.tkk7.com/yidishui/archive/2006/09/08/68581.html涓婊存按涓婊存按Fri, 08 Sep 2006 10:41:00 GMThttp://www.tkk7.com/yidishui/archive/2006/09/08/68581.htmlhttp://www.tkk7.com/yidishui/comments/68581.htmlhttp://www.tkk7.com/yidishui/archive/2006/09/08/68581.html#Feedback1http://www.tkk7.com/yidishui/comments/commentRss/68581.htmlhttp://www.tkk7.com/yidishui/services/trackbacks/68581.html榪欎釜涔熶笉鐭ラ亾鏉ヨ嚜緗戜笂閭i噷錛岃嚜宸辯敤榪囦簡(jiǎn)錛屾渶榪戞暣鐞嗚祫鏂欒褰曚笅鏉?/p>

鍘熺悊寰堢畝鍗曞氨鏄嬌鐢‵ilter澶勭悊璁劇疆鐨勮姹傜殑 CharacterEncoding

鍏蜂綋瀹炵幇Filter

package yidishui.util;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
public class EncodingFilter implements Filter {
/**
* The default character encoding to set for requests that pass through this
* filter.
*/
protected String encoding = null;
/**
* The filter configuration object we are associated with. If this value is
* null, this filter instance is not currently configured.
*/
protected FilterConfig filterConfig = null;
/**
* Should a character encoding specified by the client be ignored?
*/
protected boolean ignore = true;
// --------------------------------------------------------- Public Methods
/**
* Take this filter out of service.
*/
public void destroy() {
this.encoding = null;
this.filterConfig = null;
}
/**
* Select and set (if specified) the character encoding to be used to
* interpret request parameters for this request.
*
* @param request The servlet request we are processing
* @param response The servlet response we are creating
* @param chain The filter chain we are processing
* @throws IOException if an input/output error occurs
* @throws ServletException if a servlet error occurs
*/
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// Conditionally select and set the character encoding to be used
if (ignore || (request.getCharacterEncoding() == null)) {
String encoding = selectEncoding(request);
if (encoding != null)
request.setCharacterEncoding(encoding);
}
// Pass control on to the next filter
chain.doFilter(request, response);
}
/**
* Place this filter into service.
*
* @param filterConfig The filter configuration object
*/
public void init(FilterConfig filterConfig) throws ServletException {
this.filterConfig = filterConfig;
this.encoding = filterConfig.getInitParameter("encoding");
String value = filterConfig.getInitParameter("ignore");
if (value == null)
this.ignore = true;
else if (value.equalsIgnoreCase("true"))
this.ignore = true;
else if (value.equalsIgnoreCase("yes"))
this.ignore = true;
else
this.ignore = false;
}
// ------------------------------------------------------ Protected Methods
/**
* Select an appropriate character encoding to be used, based on the
* characteristics of the current request and/or filter initialization
* parameters. If no character encoding should be set, return
* <code>null</code>.
* <p/>
* The default implementation unconditionally returns the value configured
* by the <strong>encoding</strong> initialization parameter for this
* filter.
*
* @param request The servlet request we are processing
* @return return encoding
*/
protected String selectEncoding(ServletRequest request) {
return (this.encoding);
}
}// EOC
 

2.鍏蜂綋web.xml閰嶇疆

<filter>
<filter-name>EncodingFilter</filter-name>
<filter-class>yidishui.util.EncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>ignore</param-name>
<param-value>yes</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>EncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


涓婊存按 2006-09-08 18:41 鍙戣〃璇勮
]]>
An Introduction To JSTLhttp://www.tkk7.com/yidishui/archive/2006/08/21/64835.html涓婊存按涓婊存按Mon, 21 Aug 2006 09:20:00 GMThttp://www.tkk7.com/yidishui/archive/2006/08/21/64835.htmlhttp://www.tkk7.com/yidishui/comments/64835.htmlhttp://www.tkk7.com/yidishui/archive/2006/08/21/64835.html#Feedback0http://www.tkk7.com/yidishui/comments/commentRss/64835.htmlhttp://www.tkk7.com/yidishui/services/trackbacks/64835.html闃呰鍏ㄦ枃

涓婊存按 2006-08-21 17:20 鍙戣〃璇勮
]]>
FCKEditor 鍦↗SP涓嬌鐢?/title><link>http://www.tkk7.com/yidishui/archive/2006/08/17/64121.html</link><dc:creator>涓婊存按</dc:creator><author>涓婊存按</author><pubDate>Thu, 17 Aug 2006 06:25:00 GMT</pubDate><guid>http://www.tkk7.com/yidishui/archive/2006/08/17/64121.html</guid><wfw:comment>http://www.tkk7.com/yidishui/comments/64121.html</wfw:comment><comments>http://www.tkk7.com/yidishui/archive/2006/08/17/64121.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/yidishui/comments/commentRss/64121.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/yidishui/services/trackbacks/64121.html</trackback:ping><description><![CDATA[FCKEditor 鍦↗SP涓嬌鐢?<br />1.涓嬭澆FCKEditor2.3.1<br />2.涓嬭澆FCKeditor.Java<br />====================<br />娓呯悊FCKEdior:<br />聽 1>鍒犻櫎 _samples 閲岄潰鏄緥瀛?_testcases 嫻嬭瘯 瑕佹洿璇︾粏楂樼駭浣跨敤鏌ヤ緥瀛愬拰嫻嬭瘯,榪樻湁涓涓嬫枃浠朵笉鐢ㄧ殑鍒犻櫎<br />聽 2>鍒犻櫎 editor\_source 鍙兘鏄簮浠g爜鎶?娌℃湁浠旂粏鐮旂┒<br />聽 3> editor\filemanager\browser\default\connectors 鍒犻櫎,浣跨敤鐨勬槸servlet鏉ユ搷浣滅殑(浣跨敤鍏跺畠璇█鐨勮瘽灝辮鏍規(guī)嵁鎯呭喌澶勭悊浜?<br />聽聽聽聽 editor\filemanager\upload 鍒犻櫎,鍚屾牱浣跨敤鐨勬槸servlet<br />聽 4>editor\lang 璇█鏂囦歡,鏍規(guī)嵁鍏蜂綋搴旂敤澶勭悊<br />聽 5>editor\skins聽 鍒犻櫎涓嶆槸鐢ㄧ殑skins<br />====================<br />鍩烘湰浣跨敤:<br />1>鎶奆CKEdior鎷瘋礉鍒版牴鐩綍<br />2>鎷瘋礉FCKeditor.Java 渚嬪瓙閲岄潰鐨凢CKeditor-2.3.jar鏂囦歡<br />3>淇敼fckconfig.js<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">聽聽FCKConfig.DefaultLanguage聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽'zh</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">cn'聽榛樿璇█<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽FCKConfig.ToolbarSets[</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Default</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">]聽璁劇疆宸ュ叿鏍?br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽聽FCKConfig.ContextMenu聽璁劇疆涓婁笅鏂囪彍鍗?br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div>聽聽涓嬮潰榪樻湁濂藉,鍙互鏍規(guī)嵁鍏蜂綋鎯呭喌淇敼<br />4>jsp欏甸潰浣跨敤:<br />聽鎷瘋礉涓涓緥瀛愬氨鍙互浜?<br />聽璇存槑:oFCKeditor.setBasePath("FCKeditor/");榪欎釜璺緞鐨勬牴鎹綘鐨勫叿浣撹礬寰勫彉鍖?br />=====================<br />鏀寔涓婁紶鍔熻兘<br />1>娣誨姞:commons-fileupload.jar<br />2>淇敼Web.xml 鍏蜂綋鍦‵CKeditor.Java鏈変緥瀛?br />聽璇存槑:baseDir涓婁紶鏂囦歡淇濆瓨璺緞<br />聽聽聽聽聽 SimpleUploader涓嬬殑 enabled 鏄惁寮鍚笂浼犲姛鑳?br />聽聽聽聽聽 <url-pattern> 鏍規(guī)嵁鍏蜂綋搴旂敤榪涜淇敼<br />3>淇敼:fckconfig.js<br />聽 <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">FCKConfig.LinkBrowserURL聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽FCKConfig.BasePath聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽'filemanager</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">browser</span><span style="COLOR: #000000">/</span><span style="COLOR: #0000ff">default</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">browser.html</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">Connector</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">connectors</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">jsp</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">connector';<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽FCKConfig.ImageBrowserURL聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽FCKConfig.BasePath聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽'filemanager</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">browser</span><span style="COLOR: #000000">/</span><span style="COLOR: #0000ff">default</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">browser.html</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">Type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Image</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">Connector</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">connectors</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">jsp</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">connector';<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽FCKConfig.FlashBrowserURL聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽FCKConfig.BasePath聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽'filemanager</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">browser</span><span style="COLOR: #000000">/</span><span style="COLOR: #0000ff">default</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">browser.html</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">Type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Flash</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">Connector</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Connector</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">connectors</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">jsp</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">connector';<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽FCKConfig.LinkUploadURL聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽FCKConfig.BasePath聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽'filemanager</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">upload</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">simpleuploader</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">Type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">File';<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽FCKConfig.ImageUploadURL聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽FCKConfig.BasePath聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽'filemanager</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">upload</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">simpleuploader</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">Type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Image'聽;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />聽FCKConfig.FlashUploadURL聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽FCKConfig.BasePath聽</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">聽'filemanager</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">upload</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">simpleuploader</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">Type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">Flash'聽;</span></div><br />聽<br />聽璇存槑:瑕佸拰web.xml 鐨?url-pattern 鐩稿搴?Type=*** 瑕佸搴?br /><br />瀹屾垚!<img src ="http://www.tkk7.com/yidishui/aggbug/64121.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/yidishui/" target="_blank">涓婊存按</a> 2006-08-17 14:25 <a href="http://www.tkk7.com/yidishui/archive/2006/08/17/64121.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Ibtis鍩烘湰閰嶇疆--[娣誨姞ibatis Dao鏀寔]http://www.tkk7.com/yidishui/archive/2006/07/19/59024.html涓婊存按涓婊存按Wed, 19 Jul 2006 09:06:00 GMThttp://www.tkk7.com/yidishui/archive/2006/07/19/59024.htmlhttp://www.tkk7.com/yidishui/comments/59024.htmlhttp://www.tkk7.com/yidishui/archive/2006/07/19/59024.html#Feedback0http://www.tkk7.com/yidishui/comments/commentRss/59024.htmlhttp://www.tkk7.com/yidishui/services/trackbacks/59024.html闃呰鍏ㄦ枃

涓婊存按 2006-07-19 17:06 鍙戣〃璇勮
]]>
Ibatis鍩烘湰閰嶇疆---[鐜鎼緩]http://www.tkk7.com/yidishui/archive/2006/07/19/59021.html涓婊存按涓婊存按Wed, 19 Jul 2006 08:54:00 GMThttp://www.tkk7.com/yidishui/archive/2006/07/19/59021.htmlhttp://www.tkk7.com/yidishui/comments/59021.htmlhttp://www.tkk7.com/yidishui/archive/2006/07/19/59021.html#Feedback4http://www.tkk7.com/yidishui/comments/commentRss/59021.htmlhttp://www.tkk7.com/yidishui/services/trackbacks/59021.html闃呰鍏ㄦ枃

涓婊存按 2006-07-19 16:54 鍙戣〃璇勮
]]>
璇誨彇璧勬簮鏂囦歡http://www.tkk7.com/yidishui/archive/2006/07/18/58841.html涓婊存按涓婊存按Tue, 18 Jul 2006 12:17:00 GMThttp://www.tkk7.com/yidishui/archive/2006/07/18/58841.htmlhttp://www.tkk7.com/yidishui/comments/58841.htmlhttp://www.tkk7.com/yidishui/archive/2006/07/18/58841.html#Feedback1http://www.tkk7.com/yidishui/comments/commentRss/58841.htmlhttp://www.tkk7.com/yidishui/services/trackbacks/58841.html
driver=org.hsqldb.jdbcDriver
url=jdbc:hsqldb:mem:jpetstore
username=sa
password=

java浠g爜
聽聽聽聽聽 Properties聽props聽=聽Resources.getResourceAsProperties("properties/database.properties");
聽聽聽聽聽聽String聽url聽
=聽props.getProperty("url");
聽聽聽聽聽聽String聽driver聽
=聽props.getProperty("driver");
聽聽聽聽聽聽String聽username聽
=聽props.getProperty("username");
聽聽聽聽聽聽String聽password聽
=聽props.getProperty("password");



涓婊存按 2006-07-18 20:17 鍙戣〃璇勮
]]>
hibernate Hql 涓嶆敮鎸佷腑鏂囬棶棰橈紒錛?/title><link>http://www.tkk7.com/yidishui/archive/2006/02/19/31532.html</link><dc:creator>涓婊存按</dc:creator><author>涓婊存按</author><pubDate>Sun, 19 Feb 2006 10:16:00 GMT</pubDate><guid>http://www.tkk7.com/yidishui/archive/2006/02/19/31532.html</guid><wfw:comment>http://www.tkk7.com/yidishui/comments/31532.html</wfw:comment><comments>http://www.tkk7.com/yidishui/archive/2006/02/19/31532.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/yidishui/comments/commentRss/31532.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/yidishui/services/trackbacks/31532.html</trackback:ping><description><![CDATA[<span id="1616166" class=postbody><FONT size=2>   hibernate3.0.2涓墽琛屽涓嬬殑錛?<BR><SPAN style="FONT-WEIGHT: bold">from Persion p where p.name='寮犱笁'</SPAN>log淇℃伅,'寮犱笁'鍦ㄨ繖鏉sql杞垚sql鐨勬椂鍊欏彉鎴愪簡(jiǎn)涔辯爜<BR><BR>瑙e喅鏂規(guī)硶錛氬崌綰у埌 Hibernate3.1 rc2 ! 鍙渶瑕佹浛鎹?hibernate3.jar 鏂囦歡灝卞彲浠ヤ簡(jiǎn)!</FONT></SPAN><img src ="http://www.tkk7.com/yidishui/aggbug/31532.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/yidishui/" target="_blank">涓婊存按</a> 2006-02-19 18:16 <a href="http://www.tkk7.com/yidishui/archive/2006/02/19/31532.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>POI闂璁板綍http://www.tkk7.com/yidishui/archive/2006/02/15/30725.html涓婊存按涓婊存按Tue, 14 Feb 2006 17:51:00 GMThttp://www.tkk7.com/yidishui/archive/2006/02/15/30725.htmlhttp://www.tkk7.com/yidishui/comments/30725.htmlhttp://www.tkk7.com/yidishui/archive/2006/02/15/30725.html#Feedback0http://www.tkk7.com/yidishui/comments/commentRss/30725.htmlhttp://www.tkk7.com/yidishui/services/trackbacks/30725.html闂錛欻SSFSheet sheet1 = wb.createSheet("涓枃涔辯爜");
鏃墮棿錛?006-2-10
瑙e喅鏂規(guī)硶錛?nbsp;    

HSSFSheet sheet = wb.createSheet();// 寤虹珛鏂扮殑sheet瀵硅薄
        wb.setSheetName(0"瀛︾敓鍩烘湰淇℃伅", (short1);

*********************************************



涓婊存按 2006-02-15 01:51 鍙戣〃璇勮
]]>
jsf Hssf 鍒涘緩騫朵笅杞?M$ Excelhttp://www.tkk7.com/yidishui/archive/2006/01/21/28851.html涓婊存按涓婊存按Fri, 20 Jan 2006 18:29:00 GMThttp://www.tkk7.com/yidishui/archive/2006/01/21/28851.htmlhttp://www.tkk7.com/yidishui/comments/28851.htmlhttp://www.tkk7.com/yidishui/archive/2006/01/21/28851.html#Feedback0http://www.tkk7.com/yidishui/comments/commentRss/28851.htmlhttp://www.tkk7.com/yidishui/services/trackbacks/28851.html鍦╦sf涓氳繃FacesContext璁塊棶涓婁笅鏂囷紱
Hssf閫氳繃 HSSFWorkbook 鍚戣緭鍑烘祦鍐欏叆錛?BR>鍏蜂綋浠g爜錛?BR>
Bean錛?/P>
public class TestBean {
    
public String action() {
        HSSFWorkbook wb 
= new HSSFWorkbook();
        FacesContext context
=FacesContext.getCurrentInstance();
        HttpServletResponse response 
= (HttpServletResponse) context.getExternalContext().getResponse();
        response.reset();
        response.setContentType(
"application/ms-excel");
        
try {
            response.setHeader(
"Content-disposition""attachment;filename="+new String("涓嬭澆Excel.xls".getBytes(),"iso-8859-1"));
            wb.write(response.getOutputStream());
        }
 catch (Exception e1) {
            
// TODO Auto-generated catch block
            e1.printStackTrace();
        }

        FacesContext.getCurrentInstance().responseComplete();
        
return null;
    }

}

浠ヤ笂鍙槸涓涓┖鐨勭畝鍗曠殑Excel 鍏蜂綋鎬庝箞鍒涘緩絎﹀悎欏圭洰瑕佹眰鐨勫弬鐪嬶細(xì)HSSF GUIDE錛?BR>faces-config.xml:
<managed-bean>
        
<managed-bean-name>test</managed-bean-name>
        
<managed-bean-class>yds.study.web.TestBean</managed-bean-class>
        
<managed-bean-scope>session</managed-bean-scope>
    
</managed-bean>
jsp錛?BR>
<f:view>
    
<h:form>
        
<h:commandButton id="button" value="涓嬭澆" rendered="true"
            action
="#{test123.action}" />
    
</h:form>
</f:view>

ok榪欐牱灝卞彲浠ヤ簡(jiǎn);)

涓婊存按 2006-01-21 02:29 鍙戣〃璇勮
]]>
Jakata Poi HSSF錛氱函Java鐨凟xcel瑙e喅鏂規(guī) [zz]http://www.tkk7.com/yidishui/archive/2006/01/20/28776.html涓婊存按涓婊存按Fri, 20 Jan 2006 05:52:00 GMThttp://www.tkk7.com/yidishui/archive/2006/01/20/28776.htmlhttp://www.tkk7.com/yidishui/comments/28776.htmlhttp://www.tkk7.com/yidishui/archive/2006/01/20/28776.html#Feedback0http://www.tkk7.com/yidishui/comments/commentRss/28776.htmlhttp://www.tkk7.com/yidishui/services/trackbacks/28776.html
       鍦ㄦ垜浠疄闄呯殑寮鍙戜腑錛岃〃鐜板眰鐨勮В鍐蟲柟妗堣櫧鐒舵湁澶氭牱錛屼絾鏄疘E嫻忚鍣ㄥ凡鎴愪負(fù)鏈澶氫漢浣跨敤鐨勬祻瑙堝櫒錛屽洜涓哄ぇ瀹墮兘鐢╓indows銆傚湪浼佷笟鍔炲叕緋葷粺涓紝甯稿父鏈夊鎴瘋繖鏍峰瓙瑕佹眰錛氫綘瑕佹妸鎴戜滑鐨勬姤琛ㄧ洿鎺ョ敤Excel鎵撳紑銆?BR>
鎴栬呮槸錛氭垜浠凡緇忎範(fàn)鎯敤Excel鎵撳嵃銆傝繖鏍峰瓙濡傛灉鐢?net寮鍙戞槸娌℃湁闂鐨勶紝浣嗘槸鏈塉2EE榪欎釜姣?net鏇存湁鍓嶉旂殑寮鏀懼紡鐨勫紑鍙戠幆澧冿紝闅鵑亾鎴戜負(fù)浜?jiǎn)瑙e喯x墦鍗扮殑瑕佹眰鍘誨彟鍐欏鎴風(fēng)鐨勬帶浠訛紵鎴栬呭湪鏈嶅姟鍣ㄧ浣跨敤鏈湴浠g爜錛熺涓縐嶆柟妗堢殑闂鏄叧閿暟鎹殑澶勭悊鏈夋椂鍊欎笉鑳藉湪瀹㈡埛绔仛錛岀2縐嶆柟妗堢殑闂鏄壓鐗蹭簡(jiǎn)浠g爜鐨勫彲縐繪鎬у拰紼沖畾鎬с傚鏋滆瀹㈡埛绔彧璐熻矗澶勭悊鐢熸垚濂界殑鎶ヨ〃錛岄偅灝嗘槸涓縐嶈浜虹殑閫夋嫨銆?BR>
Apache鐨凧akata欏圭洰鐨凱OI瀛愰」鐩紝鐩爣鏄鐞唎le2瀵硅薄銆傜洰鍓嶆瘮杈冩垚鐔熺殑鏄疕SSF鎺ュ彛錛屽鐞哅S Excel錛?7-2002錛夊璞°傚畠涓嶈薄鎴戜滑浠呬粎鏄敤csv鐢熸垚鐨勬病鏈夋牸寮忕殑鍙互鐢盓xcel杞崲鐨勪笢瑗匡紝鑰屾槸鐪熸鐨凟xcel瀵硅薄錛屼綘鍙互鎺у埗涓浜涘睘鎬уsheet,cell絳夌瓑銆?BR>
榪欐槸涓涓勾杞葷殑欏圭洰錛屾墍浠ヨ薄HDF榪欐牱鐩存帴鏀寔Word瀵硅薄鐨勫ソ涓滆タ浠嶇劧鍦ㄨ璁′腑銆傚叾瀹冩敮鎸亀ord鏍煎紡鐨勭函Java鏂規(guī)榪樻湁itext錛屼笉榪囦篃鏄粛鍦ㄥ鏂椾腑銆備絾鏄疕SSF宸茬粡鎴愮啛鍒拌兘澶熷拰瓚沖鎴戜滑浣跨敤浜?jiǎn)銆?BR>
鍏跺疄錛屼粠寮鍙戝巻鍙茬殑瑙掑害璁詫紝鍦?0騫翠唬涓湡starOffice鐨勫師浣滆呭湪寰峰浗鎴愮珛浜?jiǎn)StarOffice suite鍏徃錛岀劧鍚庡埌1999騫村澶﹕tarOffice琚玸un鏀惰喘錛屽啀鍒?000騫?鏈坰tarOffice5.2鐨勫彂甯冿紱騫朵笖浠巗tarOffice6.0寮濮嬶紝starOffice寤虹珛鍦∣penOffice鐨刟pi鐨勫熀紜涓婏紝榪欎釜鍏紑浠g爜鐨刼ffice欏圭洰宸茬粡榪涜浜?jiǎn)寰堥暱鐨勬棄櫁淬傝櫧鐒墮偅鏄敱C++鍐欑殑錛屼絾鏄疨OI鐨勪唬鐮侀儴鍒嗕篃鏄敱openOffice鏀硅繃鏉ョ殑銆傛墍浠ワ紝搴旇瀵筆OI鍏呮弧瓚沖鐨勪俊蹇?jī)銆傚浗鍐呭凡緇忔湁閮ㄥ垎鍏徃鍦ㄤ粬浠殑鍔炲叕鑷姩鍖栫瓑Web欏圭洰涓嬌鐢╬oi浜?jiǎn)锛屽鏃ユ亽鐨刬office錛屾搗娉扮殑HTOffice絳夈?BR>
Java褰撳垵鎶婃牳蹇?jī)澶勭悊璁炬垚Unicode錛屽甫鏉ョ殑濂藉鏄彟浠g爜閫傚簲浜?jiǎn)澶氳瑷鐜銆傜劧鑰岀敱浜庤佸鐨勮嫳璇彧鏈?6涓瓧姣嶏紝鏈変簺鎯呭喌涓嬶紝涓浜涚▼搴忓憳鐢?浣嶇殑byte澶勭悊錛屼竴涓嶅皬蹇?jī)灏卞幚L帀浜?jiǎn)CJK鐨勯珮浣嶃傛垨鑰呮槸鐢變簬涔?fàn)鎯湪绋嬪簭涓噰鐢嫭缂栫爜锛寴q樻湁澶氱鍘熷洜錛屼嬌寰楄澶欽ava搴旂敤鍦–JK鐨勫鐞嗕笂寰堢儲(chǔ)鎭箋傝繕濂藉湪POI HSSF涓冭檻鍒拌繖涓棶棰橈紝鍙互璁劇疆encoding涓哄弻瀛楄妭銆?BR>
POI鍙互鍒皐ww.apache.org涓嬭澆鍒般傜紪璇戝ソ鐨刯ar涓昏鏈夎繖鏍?涓細(xì)poi鍖?poi Browser鍖?poi hdf鍖?poi hssf渚嬬▼鍖呫傚疄闄呰繍琛屾椂錛岄渶瑕佹湁poi鍖呭氨鍙互浜?jiǎn)銆?BR>
濡傛灉鐢↗akarta ant緙栬瘧鍜岃繍琛岋紝涓嬭澆apache Jakarta POI鐨剅elease涓殑src鍖咃紝瀹冮噷闈㈠凡緇忎負(fù)浣犵敓鎴愬ソ浜?jiǎn)build鏂囦歡浜?jiǎn)銆傚彧瑕佽繍琛宎nt灝卞彲浠ヤ簡(jiǎn)(ant 鐨勫畨瑁呭拰浣跨敤鍦ㄦ涓嶈浜?銆傚鏋滄槸鐢↗builder 榪愯錛岃鍦ㄦ柊寤虹殑欏圭洰涓姞鍏oi鍖呫?BR>
浠builder6涓轟緥錛岄夋嫨Tools鑿滃崟欏圭殑config libraries...閫夐」錛屾柊寤轟竴涓猯ib銆傚湪寮瑰嚭鐨勮彍鍗曚腑閫夋嫨poi鍖咃紝濡傝繖涓猨akarta-poi-1.5.1-final-20020820.jar錛屾妸poi娣誨姞鍒癹builder涓傜劧鍚庯紝鍙抽敭鐐瑰嚮浣犵殑欏圭洰錛屽湪project鐨刾roperties鑿滃崟涓璸ath鐨剅equired Libraries涓紝鐐筧dd錛屾坊鍔犲垰鎵嶅姞鍏ュ埌jbuilder涓殑poi鍒頒綘鐜板湪鐨勯」鐩腑銆?BR>
濡傛灉浣犱粎浠呮槸涓轟簡(jiǎn)鐔熸?zhèn)塒OI hssf鐨勪嬌鐢紝鍙互鐩存帴鐪婸OI鐨剆amples鍖呬腑鐨勬簮浠g爜錛屽茍涓旇繍琛屽畠銆俬ssf鐨勫悇縐嶅璞¢兘鏈変緥紼嬬殑浠嬬粛銆俬ssf鎻愪緵鐨勪緥紼嬪湪org.apache.poi.hssf.usermodel.examples鍖呬腑錛屽叡鏈?4涓紝鐢熸垚鐨勭洰鏍噚ls閮芥槸workbook.xls銆傚鏋滀綘鎯崇湅鏇村鐨勪緥紼嬶紝鍙互鍙傝僪ssf鐨凧unit test cases錛屽湪poi鐨勫寘鐨勬簮浠g爜涓湁銆俬ssf閮芥湁嫻嬭瘯浠g爜銆?BR>榪欓噷鍙閮ㄥ垎渚嬬▼鐨勫疄鐜板仛浠嬬粛銆?BR>
HSSF鎻愪緵緇欑敤鎴蜂嬌鐢ㄧ殑瀵硅薄鍦╫rg.apache.poi.hssf.usermodel鍖呬腑,涓昏閮ㄥ垎鍖呮嫭Excell瀵硅薄錛屾牱寮忓拰鏍煎紡錛岃繕鏈夎緟鍔╂搷浣溿傛湁浠ヤ笅鍑犵瀵硅薄錛?BR>
HSSFWorkbook excell鐨勬枃妗e璞?BR>
HSSFSheet excell鐨勮〃鍗?BR>
HSSFRow excell鐨勮

HSSFCell excell鐨勬牸瀛愬崟鍏?BR>
HSSFFont excell瀛椾綋

HSSFName 鍚嶇О

HSSFDataFormat 鏃ユ湡鏍煎紡

鍦╬oi1.7涓墠鏈変互涓?欏癸細(xì)

HSSFHeader sheet澶?BR>
HSSFFooter sheet灝?BR>
鍜岃繖涓牱寮?BR>
HSSFCellStyle cell鏍峰紡

杈呭姪鎿嶄綔鍖呮嫭

HSSFDateUtil 鏃ユ湡

HSSFPrintSetup 鎵撳嵃

HSSFErrorConstants 閿欒淇℃伅琛?BR>
浠旂粏鐪媜rg.apache.poi.hssf鍖呯殑緇撴瀯錛屼笉闅懼彂鐜癏SSF鐨勫唴閮ㄥ疄鐜伴伒寰殑鏄疢VC妯″瀷銆?BR>
榪欓噷鎴戠敤Rose鎶妎rg.apache.poi.hssf.usermodel鍖呬腑鐨勫璞″弽鍚戝鍏ュ茍鏍規(guī)嵁鐩鎬簰鍏崇郴浣滀簡(jiǎn)鏁寸悊錛岃瑙佷笅闈袱鍥撅細(xì)







鍥? 鍩烘湰瀵硅薄



浠庝腑涓嶉毦鍙互鍙戠幇姣忎竴涓熀鏈璞¢兘鍏寵仈浜?jiǎn)涓涓猂ecord瀵硅薄銆俁ecord瀵硅薄鏄竴涓弬鑰僌ffice鏍煎紡鐨勭浉鍏寵褰曘?nbsp;





鍥? HSSFWorkbook



HSSFWorkbook鍗蟲槸涓涓狤xcell瀵硅薄銆傝繖騫呯被鍥句綋鐜扮殑鏄疕SSFWorkbook鍜屽熀鏈璞$殑鐩鎬簰鍏崇郴銆傚彲瑙侊紝璁稿瀵硅薄涓篃寤虹珛浜?jiǎn)Workbook鐨勫紩鐢ㄣ傝繕闇瑕佹敞鎰忕殑鏄湪HSSFWorkbook鍜孒SSFSheet涓緩绔嬩簡(jiǎn)log鏈哄埗POILogger錛岃屼笖POILogger涔熸槸浣跨敤apache Log4J瀹炵幇鐨勩?BR>
鍏堢湅poi鐨別xamples鍖呬腑鎻愪緵鐨勬渶綆鍗曠殑渚嬪瓙錛屽緩绔嬩竴涓┖xls鏂囦歡銆?BR>

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import java.io.FileOutputStream;
import java.io.IOException;
public class NewWorkbook
{
public static void main(String[] args)throws IOException
{
HSSFWorkbook wb 
= new HSSFWorkbook();
//寤虹珛鏂癏SSFWorkbook瀵硅薄
FileOutputStream fileOut =
new FileOutputStream("workbook.xls"錛?
wb.write(fileOut);
//鎶奧orkbook瀵硅薄杈撳嚭鍒版枃浠秝orkbook.xls涓?/SPAN>
fileOut.close();
}

}





閫氳繃榪欎釜渚嬪瓙錛屾垜浠緩绔嬬殑鏄竴涓┖鐧界殑xls鏂囦歡錛堜笉鏄┖鏂囦歡錛夈傚湪姝ゅ熀紜涓婏紝鎴戜滑鍙互榪涗竴姝ョ湅鍏跺畠鐨勪緥瀛愩?nbsp;


import org.apache.poi.hssf.usermodel.*;

import java.io.FileOutputStream;

import java.io.IOException;

public class CreateCells

{

public static void main(String[] args)

throws IOException

{

HSSFWorkbook wb 
= new HSSFWorkbook();
//寤虹珛鏂癏SSFWorkbook瀵硅薄

HSSFSheet sheet 
= wb.createSheet("new sheet"錛?
//寤虹珛鏂扮殑sheet瀵硅薄


// Create a row and put some cells in it.
Rows are 0 based.

HSSFRow row 
= sheet.createRow((short)0);
//寤虹珛鏂拌

// Create a cell and put a value in it.

HSSFCell cell 
= row.createCell((short)0);
//寤虹珛鏂癱ell

cell.setCellvalue(
1);//璁劇疆cell鐨勬暣鏁扮被鍨嬬殑鍊?BR>

// Or do it on one line.

row.createCell((
short)1).setCellvalue(1.2);
//璁劇疆cell嫻偣綾誨瀷鐨勫?/SPAN>

row.createCell((
short)2).setCellvalue("test"錛?
//璁劇疆cell瀛楃綾誨瀷鐨勫?/SPAN>

row.createCell((
short)3).setCellvalue(true);
//璁劇疆cell甯冨皵綾誨瀷鐨勫?nbsp;

HSSFCellStyle cellStyle 
= wb.createCellStyle();
//寤虹珛鏂扮殑cell鏍峰紡

cellStyle.setDataFormat
(HSSFDataFormat.getFormat(
"m/d/yy h:mm"錛夛級(jí);
//璁劇疆cell鏍峰紡涓哄畾鍒剁殑鏃ユ湡鏍煎紡

HSSFCell dCell 
=row.createCell((short)4);

dCell.setCellvalue(
new Date());
//璁劇疆cell涓烘棩鏈熺被鍨嬬殑鍊?/SPAN>

dCell.setCellStyle(cellStyle); 
//璁劇疆璇ell鏃ユ湡鐨勬樉紺烘牸寮?/SPAN>

HSSFCell csCell 
=row.createCell((short)5);

csCell.setEncoding(HSSFCell.ENCODING_UTF_16);
//璁劇疆cell緙栫爜瑙e喅涓枃楂樹綅瀛楄妭鎴柇

csCell.setCellvalue(
"涓枃嫻嬭瘯_Chinese Words Test"錛?
//璁劇疆涓タ鏂囩粨鍚堝瓧絎︿覆

row.createCell((
short)6).setCellType
(HSSFCell.CELL_TYPE_ERROR);
//寤虹珛閿欒cell


// Write the output to a file

FileOutputStream fileOut 
= 
new FileOutputStream("workbook.xls"錛?

wb.write(fileOut);

fileOut.close();

}


}





鎴戠◢寰慨鏀逛簡(jiǎn)鍘熸潵鐨別xamples鍖呬腑鐨凜reateCells綾誨啓浜?jiǎn)涓婇潰鐨勫姛鑳綃箣璇暰c匯傞氳繃榪欎釜渚嬪瓙錛屾垜浠彲浠ユ竻妤氱殑鐪嬪埌xls鏂囦歡浠庡ぇ鍒板皬鍖呮嫭浜?jiǎn)HSSFWorkbook HSSFSheet HSSFRow HSSFCell榪欐牱鍑犱釜瀵硅薄銆傛垜浠彲浠ュ湪cell涓緗悇縐嶇被鍨嬬殑鍊箋?nbsp;

灝ゅ叾瑕佹敞鎰忕殑鏄鏋滀綘鎯蟲紜殑鏄劇ず闈炴緹庣殑瀛楃鏃訛紝灝ゅ叾璞′腑鏃ラ煩榪欐牱鐨勮璦錛屽繀欏昏緗紪鐮佷負(fù)16浣嶇殑鍗蟲槸HSSFCell.ENCODING_UTF_16錛屾墠鑳戒繚璇佸瓧絎︾殑楂?浣嶄笉琚埅鏂屽紩璧風(fēng)紪鐮佸け鐪熷艦鎴愪貢鐮併?nbsp;

鍏朵粬嫻嬭瘯鍙互閫氳繃鍙傝僥xamples鍖呬腑鐨勬祴璇曚緥瀛愭帉鎻oi鐨勮緇嗙敤娉曪紝鍖呮嫭瀛椾綋鐨勮緗紝cell澶у皬鍜屼綆綰圭殑璁劇疆絳夈傞渶瑕佹敞鎰忕殑鏄疨OI鏄竴涓粛鐒跺湪瀹屽杽涓殑鍏紑浠g爜鐨勯」鐩紝鎵浠ユ湁浜涘姛鑳芥鍦ㄤ笉鏂殑鎵╁厖銆?nbsp;

濡侶SSFSheet鐨刧etFooter() getHeader()鍜宻etFooter(HSSFFooter hsf) setHeader(HSSFHeader hsh)鏄湪POI1.7涓墠鏈夌殑錛岃孭OI1.5涓氨娌℃湁銆傝繍琛屾祴璇曠啛鎮(zhèn)変唬鐮佹垨鑰呬嬌鐢ㄥ畠鍋氶」鐩椂璇鋒敞鎰廝OI鐨勭増鏈?nbsp;

鍙﹀闇瑕佹敞鎰忕殑鏄疕SSF涔熸湁瀹冪殑瀵箈ls鍩轟簬浜嬩歡鐨勮В鏋愩傚彲浠ュ弬鑰冧緥紼嬩腑鐨凟ventExample.java銆傚畠閫氳繃瀹炵幇HSSFListener瀹屾垚浠庢櫘閫氭祦璁ょ煡Xls涓寘鍚殑鍐呭錛屽湪apache Cocoon涓殑org.apache.cocoon.serialization.HSSFSerializer涓敤鍒頒簡(jiǎn)榪欎釜瑙f瀽銆傚洜涓篊ocoon2鏄熀浜庝簨浠剁殑錛屾墍浠OI涓轟簡(jiǎn)鎻愪緵蹇熺殑瑙f瀽涔熸彁渚涗簡(jiǎn)鐩稿簲鐨勪簨浠躲傚綋鐒舵垜浠嚜宸變篃鍙互瀹炵幇榪欎釜浜嬩歡鎺ュ彛銆?nbsp;

鍥犱負(fù)POI榪樹笉鏄竴涓凍澶熸垚鐔熺殑欏圭洰錛屾墍浠ユ湁蹇呰鍋氳繘涓姝ョ殑寮鍙戝拰嫻嬭瘯銆備絾鏄畠宸茬粡涓烘垜浠敤綰疛ava鎿嶄綔ole2瀵硅薄鎻愪緵浜?jiǎn)鍙兘锛岃屼笖鍏嬫湇浜?jiǎn)ole瀵硅薄璋冪敤鐨勭己闄鳳紝鎻愪緵浜?jiǎn)鏈嶅姟鍣ㄧ鐨凟xcel瑙e喅鏂規(guī)銆?BR>

涓婊存按 2006-01-20 13:52 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 中文免费观看视频网站| 插B内射18免费视频| 国产一级淫片a免费播放口| 18女人水真多免费高清毛片| 老司机亚洲精品影视www| 亚洲成在人线中文字幕| 免费观看又污又黄在线观看| 你好老叔电影观看免费| 亚洲一区二区视频在线观看| 免费无码一区二区| 亚洲成A人片在线观看无码3D| 91精品国产亚洲爽啪在线观看| 黑人粗长大战亚洲女2021国产精品成人免费视频| 无码日韩人妻AV一区免费l| 国产精品久久免费| 国产精品亚洲美女久久久 | 亚洲免费日韩无码系列| 国产精品免费久久| 午夜亚洲国产理论秋霞| 成人亚洲国产精品久久| 亚洲精品美女久久久久99小说| 国产精品亚洲va在线观看| 亚洲男人av香蕉爽爽爽爽| 免费无码又爽又刺激网站| 亚洲电影免费观看| 成人看的午夜免费毛片| 美女被免费网站视频在线| 国产一卡二卡四卡免费| 亚洲大尺度无码无码专线一区 | 亚洲国产精品第一区二区三区| 成人网站免费大全日韩国产| 亚洲国产天堂在线观看| 无码国产精品久久一区免费| 亚洲成年人在线观看| 69xx免费观看视频| 免费激情网站国产高清第一页| 亚洲精品无码永久在线观看你懂的| 91久久青青草原线免费| 在线观看亚洲视频| 久久亚洲国产成人亚| 午夜免费福利网站|