锘??xml version="1.0" encoding="utf-8" standalone="yes"?> 鍘熺悊寰堢畝鍗曞氨鏄嬌鐢‵ilter澶勭悊璁劇疆鐨勮姹傜殑 CharacterEncoding 鍏蜂綋瀹炵幇Filter 2.鍏蜂綋web.xml閰嶇疆
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
<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>
]]>
]]>
2.涓嬭澆FCKeditor.Java
====================
娓呯悊FCKEdior:
聽 1>鍒犻櫎 _samples 閲岄潰鏄緥瀛?_testcases 嫻嬭瘯 瑕佹洿璇︾粏楂樼駭浣跨敤鏌ヤ緥瀛愬拰嫻嬭瘯,榪樻湁涓涓嬫枃浠朵笉鐢ㄧ殑鍒犻櫎
聽 2>鍒犻櫎 editor\_source 鍙兘鏄簮浠g爜鎶?娌℃湁浠旂粏鐮旂┒
聽 3> editor\filemanager\browser\default\connectors 鍒犻櫎,浣跨敤鐨勬槸servlet鏉ユ搷浣滅殑(浣跨敤鍏跺畠璇█鐨勮瘽灝辮鏍規(guī)嵁鎯呭喌澶勭悊浜?
聽聽聽聽 editor\filemanager\upload 鍒犻櫎,鍚屾牱浣跨敤鐨勬槸servlet
聽 4>editor\lang 璇█鏂囦歡,鏍規(guī)嵁鍏蜂綋搴旂敤澶勭悊
聽 5>editor\skins聽 鍒犻櫎涓嶆槸鐢ㄧ殑skins
====================
鍩烘湰浣跨敤:
1>鎶奆CKEdior鎷瘋礉鍒版牴鐩綍
2>鎷瘋礉FCKeditor.Java 渚嬪瓙閲岄潰鐨凢CKeditor-2.3.jar鏂囦歡
3>淇敼fckconfig.js聽聽FCKConfig.DefaultLanguage聽=聽'zh-cn'聽榛樿璇█
聽聽FCKConfig.ToolbarSets["Default"]聽璁劇疆宸ュ叿鏍?br />
聽聽FCKConfig.ContextMenu聽璁劇疆涓婁笅鏂囪彍鍗?br />
4>jsp欏甸潰浣跨敤:
聽鎷瘋礉涓涓緥瀛愬氨鍙互浜?
聽璇存槑:oFCKeditor.setBasePath("FCKeditor/");榪欎釜璺緞鐨勬牴鎹綘鐨勫叿浣撹礬寰勫彉鍖?br />=====================
鏀寔涓婁紶鍔熻兘
1>娣誨姞:commons-fileupload.jar
2>淇敼Web.xml 鍏蜂綋鍦‵CKeditor.Java鏈変緥瀛?br />聽璇存槑:baseDir涓婁紶鏂囦歡淇濆瓨璺緞
聽聽聽聽聽 SimpleUploader涓嬬殑 enabled 鏄惁寮鍚笂浼犲姛鑳?br />聽聽聽聽聽 <url-pattern> 鏍規(guī)嵁鍏蜂綋搴旂敤榪涜淇敼
3>淇敼:fckconfig.js
聽
FCKConfig.LinkBrowserURL聽=聽FCKConfig.BasePath聽+聽'filemanager/browser/default/browser.html?Connector=connectors/jsp/connector';
聽FCKConfig.ImageBrowserURL聽=聽FCKConfig.BasePath聽+聽'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector';
聽FCKConfig.FlashBrowserURL聽=聽FCKConfig.BasePath聽+聽'filemanager/browser/default/browser.html?Type=Flash&Connector=Connector=connectors/jsp/connector';
聽FCKConfig.LinkUploadURL聽=聽FCKConfig.BasePath聽+聽'filemanager/upload/simpleuploader?Type=File';
聽FCKConfig.ImageUploadURL聽=聽FCKConfig.BasePath聽+聽'filemanager/upload/simpleuploader?Type=Image'聽;
聽FCKConfig.FlashUploadURL聽=聽FCKConfig.BasePath聽+聽'filemanager/upload/simpleuploader?Type=Flash'聽;
聽
聽璇存槑:瑕佸拰web.xml 鐨?url-pattern 鐩稿搴?Type=*** 瑕佸搴?br />
瀹屾垚!
]]>
]]>
]]>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");
]]>
from Persion p where p.name='寮犱笁'log淇℃伅,'寮犱笁'鍦ㄨ繖鏉sql杞垚sql鐨勬椂鍊欏彉鎴愪簡(jiǎn)涔辯爜
瑙e喅鏂規(guī)硶錛氬崌綰у埌 Hibernate3.1 rc2 ! 鍙渶瑕佹浛鎹?hibernate3.jar 鏂囦歡灝卞彲浠ヤ簡(jiǎn)!
]]>
鏃墮棿錛?006-2-10
瑙e喅鏂規(guī)硶錛?nbsp;
*********************************************