锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲黄色免费在线观看,亚洲三级中文字幕,亚洲精品V欧洲精品V日韩精品http://m.tkk7.com/qiyadeng/category/3460.htmlif(log.itWillForget()){ <br>&nbsp;&nbsp; log.blog("log4deng!"); <br> }<br> else if(log.isYourExperience){ <br>&nbsp;&nbsp; log.blog("log4deng!"); <br> }<br> ......zh-cnWed, 28 Feb 2007 00:39:16 GMTWed, 28 Feb 2007 00:39:16 GMT60Struts Checkbox radio鎬庝箞榪涜鍔ㄦ佺殑閫夋嫨http://m.tkk7.com/qiyadeng/articles/23776.htmlqiyadengqiyadengWed, 14 Dec 2005 02:19:00 GMThttp://m.tkk7.com/qiyadeng/articles/23776.htmlhttp://m.tkk7.com/qiyadeng/comments/23776.htmlhttp://m.tkk7.com/qiyadeng/articles/23776.html#Feedback0http://m.tkk7.com/qiyadeng/comments/commentRss/23776.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/23776.html浣跨敤Struts鐨勬湅鍙嬶紝鍙兘緇忓父鍙戠幇浣跨敤欏甸潰鐨勪竴浜涙爣絳劇殑鏃跺欒寰椾笉澶熷緱蹇?jī)搴旀墜銆傛瘮濡傛垜浠璁捐涓涓敤鎴蜂慨鏀瑰緱淇℃伅鐨勭晫闈紝闇瑕佽皟鍑轟竴浜涚敤鎴風(fēng)殑淇℃伅銆備笉騫哥殑鏄紝褰撻〉闈腑鍚湁Checkbox鎴栨槸radio鐨勬椂鍊欐湁娌℃湁鎯寵繃鎬庝箞澶勭悊錛熶互鍓嶆垜涔熶負(fù)榪欎釜鑻︽伡錛屼笉灝戣鍧涗笂鐨勪漢涔熷彂甯栧瓙闂繖涓棶棰樸傛渶榪戠湅鍒頒簡(jiǎn)涓ょ瘒鏂囩珷錛屽彲浠ヨВ鍐寵繖涓棶棰樸傛潵鑷狪BM developer:
http://www-128.ibm.com/developerworks/java/library/j-sr3.html
http://www-128.ibm.com/developerworks/java/library/j-sr4.html
multibox.bmpradio.bmp
鍏堣皟綆鍗曠殑璇磋搗鍚э紝鎴戜滑鏉ュ疄鐜板姩鎬佺殑checkbox:
1銆丗orm鐨勮璁★細(xì)鎴戜滑榪欎釜渚嬪瓙鏈変釜String[] mountains錛岃繖涓彉閲忔暟緇勪腑鍖呭惈寰堝鐨勫北鐨勫悕瀛?榪樻湁涓暟緇凷tring[] selectedMountains灝辨槸榛樿閫変腑鐨勪竴浜涘北錛屽儚涓嬮潰榪欐牱寰堢畝鍗曘?/P>

public class MultiboxForm extends ActionForm {
 
 private String[] selectedMountains = {"Everest","K2","Lhotse","Cho Oyu"};
 private String[] mountains ={"Everest","K2","Kangchenjunga","Lhotse","Makalu","Kangchenjunga South","Lhotse Middle","Kangchenjunga West","Lhotse Shar","Cho Oyu"};

 public String[] getMountains() {
  return mountains;
 }
 public void setMountains(String[] mountains) {
  this.mountains = mountains;
 }
 public String[] getSelectedMountains() {
  return selectedMountains;
 }
 public void setSelectedMountains(String[] selectedMountains) {
  this.selectedMountains = selectedMountains;
 }

2銆丄ction鐨勮璁★細(xì)榪欎釜灝辨洿綆鍗曚簡(jiǎn)錛屼竴鍙ヨ瘽錛岀敱鎺у埗鍣ㄥ垏鎹㈠埌瑙嗗浘銆?PRE class=code>
 return mapping.findForward("success");
3銆丣SP鐨勮璁★細(xì)

  <html:form action="/multibox" name="multiboxForm" type="qiya.deng.struts.form.MultiboxForm">
   <logic:iterate name="multiboxForm" property="mountains" id="mountain">
    <html:multibox property="selectedMountains">
     <bean:write name="mountain"/>
    </html:multibox>
    <bean:write name="mountain"/><br/>
   </logic:iterate>
   <br/>
   <html:submit/><html:cancel/>
  </html:form>
榪欎釜鐩稿姣旇緝澶嶆潅錛屼篃鏄瘮杈冧腑瑕佺殑銆?lt;logic:iterate/>鏄凱浠ultiboxForm涓殑mountians,
<html:multibox property="selectedMountains">
 <bean:write name="mountain"/>
</html:multibox>
榪欎釜鏍囩鐨勪綔鐢ㄥ氨鏄痵electeDMountains鐨勫煎拰榪唬鐨刴ountain鍊間竴鑷寸殑鏃跺欏氨浼?xì)閫変腑銆?

鎺ヤ笅鏉ヨRadio錛屽叾瀹濬orm鍜孉ction閮ㄥ垎閮藉樊涓嶅錛屽彧鏄疛SP欏甸潰鏈夌偣涓嶄竴鏍鳳紝Radio閲岄潰鐢氳嚦鐗墊秹鍒頒簡(jiǎn)JavaScript銆?BR>1.From鐨勮璁★細(xì)


 private String selectedMountain = "Kangchenjunga West";
 private String[] mountains ={"Everest","K2","Kangchenjunga","Lhotse","Makalu","Kangchenjunga South","Lhotse Middle","Kangchenjunga West","Lhotse Shar","Cho Oyu"};
 
 public String[] getMountains() {
  return mountains;
 }
 public void setMountains(String[] mountains) {
  this.mountains = mountains;
 }
 public String getSelectedMountain() {
  return selectedMountain;
 }
 public void setSelectedMountain(String selectedMountain) {
  this.selectedMountain = selectedMountain;
 }
2.Action鍚屼笂涓鏍鳳紝鍒囨崲鍒癑SP欏甸潰鍘匯?nbsp;
3.閲嶇偣閮ㄥ垎JSP:

  <html:form action="/radio" name="radioForm" type="qiya.deng.struts.form.RadioForm">
   <bean:define id="selectedRadio" property="selectedMountain" name="radioForm"></bean:define>
   <logic:iterate id="mountain" property="mountains" name="radioForm">
    <bean:define id="mountainValue">
     <bean:write name="mountain"/>
    </bean:define>
    <html:radio property="selectedMountain" value="<%=mountainValue%>" styleId="<%=mountainValue%>"/>
    <bean:write name="mountain"/><br/>
   </logic:iterate><br/>
   <html:submit/><html:cancel/>
   <script type="text/javascript">
             <!--
          var selectedRadio =
             document.forms["radioForm"].elements["<bean:write name="selectedRadio"/>"];
              selectedRadio.checked=true;
             -->
         </script>
  </html:form>


"<bean:define/>"瀹氫箟浜?jiǎn)涓涓狿ageContext浣滅敤鍩熺殑灞炴electedRadio錛屼笅闈㈢殑JavaScript鐨勪綔鐢ㄥ氨鏄牴鎹繖涓睘鎬ф壘鍒板簲璇ラ変腑鐨凴adio銆傚叾浠栫殑鍦版柟鍜屼笂闈㈤偅涓緢鐩鎬技鐨勩傚鏋滆繕鏄笉澶悊瑙e厛榪愯錛岀湅鐪嬬敓鎴愮殑HTML浠g爜銆?BR>



qiyadeng 2005-12-14 10:19 鍙戣〃璇勮
]]>
tab tag 涓嶴truts鏁村悎http://m.tkk7.com/qiyadeng/articles/22843.htmlqiyadengqiyadengWed, 07 Dec 2005 04:45:00 GMThttp://m.tkk7.com/qiyadeng/articles/22843.htmlhttp://m.tkk7.com/qiyadeng/comments/22843.htmlhttp://m.tkk7.com/qiyadeng/articles/22843.html#Feedback2http://m.tkk7.com/qiyadeng/comments/commentRss/22843.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/22843.html鍙戠幇涓涓瘮杈冮叿鐨凾ab鏍囩錛岃繖涓爣絳懼緢灝忥紝浣嗘槸鍩烘湰涓婅兘閫傜敤浜庝竴鑸殑搴旂敤銆傚畠鐨勫叏縐版槸The Ditchnet JSP Tabs Taglib 錛堬級(jí)http://209.61.157.8:8080/taglibs/錛屽彲浠ョ湅鍑烘槸JSP鐨勬爣絳俱備絾鏄垜浠幇鍦ㄥ緢澶氶」鐩兘鏄熀浜嶴truts錛屾墍浠ラ渶瑕佺畝鍗曠殑鏉ヤ釜鏁村悎銆?BR>
鍦ㄥ畠鐨勭綉绔欎笂鏈夋瘮杈冭緇嗙殑瀹夎璇存槑錛屽茍涓旈厤鏈夊疄渚嬨傞渶瑕佺殑璇昏呭彲浠ヤ粩緇嗘煡鐪嬶紝榪欓噷灝變笉浠嬬粛浜?jiǎn)銆?BR>鍦ㄤ嬌鐢ㄧ殑JSP欏甸潰涓姞鍏?pre class="code">
<head>
   <tab:tabConfig/>
</head>
榪欐槸瀵煎叆涓浜汣SS鍜孞avaScript.
鐒跺悗鍩烘湰涓婂氨鏄袱濂楁爣絳撅細(xì)
<tab:tabContainer>
<tab:tabPane>
浠庡懡鍚嶆垜浠氨寰堝鏄撶湅鍑烘潵鏄粈涔堜綔鐢?lt;tab:tabContainer>鏄浉褰撲簬瀹瑰櫒涓鏍風(fēng)殑涓滆タ鍙互鍖呭惈寰堝鐨?lt;tab:tabPane>,鑰?lt;tab:tabPane>灝辨槸鎴戜滑瑕佺殑閭gTab鐨勬晥鏋滅殑闈㈡澘銆?pre class="code">
  <tab:tabContainer id="foo-bar-container">
     <tab:tabPane id="foo" tabTitle="濮撳悕">
       <html:errors/><br/>
     <bean:message key="tab_textfield_name"/>
     <html:text property="userName"></html:text>
     <br/>
     <html:submit><bean:message key="tab_submit_label"/></html:submit>
   </tab:tabPane>
   <tab:tabPane id="bar" tabTitle="瀵嗙爜">
    <html:errors/><br/>
     <bean:message key="tab_textfield_password"/>
      <html:password property="password"/>
      <br/>
     <bean:message key="tab_textfield_repassword"/>
      <html:password property="rePassword"/>
      <br/>
     <html:submit><bean:message key="tab_submit_label"/></html:submit>
   </tab:tabPane>
  </tab:tabContainer>
娉ㄦ剰涓婇潰鐨勪袱涓爣絳鵑兘鏈塱d榪欒鏄敮涓鐨勶紝鑰屼笖鏄暣涓簲鐢ㄥ敮涓銆?BR>
涓婇潰鐨勪唬鐮佸氨鏄竴涓〃鍗曪紝鍚湁userName,password,rePassword涓変釜鏂囨湰鍩熴備絾鏄渶瑕佷竴涓狥orm,鏈夋病鏈夎冭檻榪嘑orm鏀懼湪浠涔堜綅緗憿錛熺粡榪囪瘯楠屾垜鍙戠幇瑕佸皢Form 鏀懼埌<tab:tabContainer>鐨勬爣絳句箣澶栥傝繖鏍峰氨鍍忓鐞嗕竴涓櫘閫氱殑Struts Form涓鏍蜂簡(jiǎn)銆傚鏋滀綘闇瑕佹瘡涓猅ab涔熷彲浠ユ槸涓狥orm錛岃繖鏍蜂篃娌℃湁浠涔堥棶棰樸?BR>
瀹屾暣鐨凧SP浠g爜濡備笅:


<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="tab" uri="<%@ taglib prefix="html" uri="<%@ taglib prefix="bean" uri="<html>
 <head>
  <tab:tabConfig/>
 </head>
  <body>
 <html:form action="/saveAll">
  <tab:tabContainer id="foo-bar-container">
    <tab:tabPane id="foo" tabTitle="濮撳悕">
     <html:errors/><br/>
     <bean:message key="tab_textfield_name"/>
     <html:text property="userName"></html:text>
     <br/>
     <html:submit><bean:message key="tab_submit_label"/></html:submit>
   </tab:tabPane>
    <tab:tabPane id="bar" tabTitle="瀵嗙爜">
    <html:errors/><br/>
     <bean:message key="tab_textfield_password"/>
      <html:password property="password"/>
      <br/>
     <bean:message key="tab_textfield_repassword"/>
      <html:password property="rePassword"/>
      <br/>
     <html:submit><bean:message key="tab_submit_label"/></html:submit>
    </tab:tabPane>
   </tab:tabContainer>
 </html:form> 
 </body>
</html>
鏁堟灉濡傚浘錛?BR>Snap2.bmp



qiyadeng 2005-12-07 12:45 鍙戣〃璇勮
]]>
Struts涔嬭嚜瀹氫箟Validatorhttp://m.tkk7.com/qiyadeng/articles/17571.htmlqiyadengqiyadengMon, 31 Oct 2005 10:00:00 GMThttp://m.tkk7.com/qiyadeng/articles/17571.htmlhttp://m.tkk7.com/qiyadeng/comments/17571.htmlhttp://m.tkk7.com/qiyadeng/articles/17571.html#Feedback0http://m.tkk7.com/qiyadeng/comments/commentRss/17571.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/17571.html 姣斿鎴戜滑鎯沖畾涔変竴涓鍒欐潵鍒ゅ畾涓ゆ杈撳叆鐨勫瘑鐮佹槸鐩哥瓑鐨勩傛垜浠渶瑕佽繖鏍峰仛錛岄鍏堟垜浠渶瑕佷竴涓被錛岃薄榪欐牱瀛?錛?br>
package com.motel168.util;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.validator.Field;
import org.apache.commons.validator.GenericValidator;
import org.apache.commons.validator.ValidatorAction;
import org.apache.commons.validator.ValidatorUtil;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.validator.Resources;

public class MyValidator {
聽聽聽 public static boolean validateTwoFields(Object bean,ValidatorAction va,Field field,ActionErrors errors,HttpServletRequest request){
聽聽聽 聽聽聽
聽聽聽 聽聽聽 String value = ValidatorUtil.getValueAsString(bean,field.getProperty());
聽聽聽 聽聽聽 String sProperty2 = field.getVarValue("secondProperty");
聽聽聽 聽聽聽 String value2 = ValidatorUtil.getValueAsString(bean,sProperty2);
聽聽聽 聽聽聽 if(!GenericValidator.isBlankOrNull(value)){
聽聽聽 聽聽聽 聽聽聽 try{
聽聽聽 聽聽聽 聽聽聽 聽聽聽 if(!value.equals(value2)){
聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 errors.add(field.getKey(),Resources.getActionError(request,va,field));
聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 return false;
聽聽聽 聽聽聽 聽聽聽 聽聽聽 }
聽聽聽 聽聽聽 聽聽聽 }catch(Exception e){
聽聽聽 聽聽聽 聽聽聽 聽聽聽 errors.add(field.getKey(),Resources.getActionError(request,va,field));
聽聽聽 聽聽聽 聽聽聽 聽聽聽 return false;
聽聽聽 聽聽聽 聽聽聽 }
聽聽聽 聽聽聽 }
聽聽聽 聽聽聽 return true;
聽聽聽 }
聽聽聽
}

涓婇潰榪欎釜綾誨氨鏄敤鏉ュ垽鏂袱涓煙鏄惁鐩哥瓑錛屽緢綆鍗曪紝浣嗘槸娉ㄦ剰鏂規(guī)硶鍚嶄竴瀹氳鏄痸alidateXXX銆?br>
鎺ヤ笅鏉ラ渶瑕佹墿灞晇alidator-rules.xml,鍦?/global>涔嬪墠鍔犲叆榪欎箞涓孌?
聽聽聽 聽 
聽聽聽 聽 聽聽聽 聽聽聽
聽聽聽
聽methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest"
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽depends="required" msg="errors.twofield">
聽聽聽 聽
聽聽聽 聽 聽聽聽 聽聽聽 function validateTwoFields(form){
聽聽聽 聽 聽聽聽 聽聽聽 var bValid = true;
聽聽聽 聽 聽聽聽 聽聽聽 var focusField = null;
聽聽聽 聽 聽聽聽 聽聽聽 var i = 0;
聽聽聽 聽 聽聽聽 聽聽聽 var fields = new Array();
聽聽聽 聽 聽聽聽 聽聽聽 oTwoFields = new twofields();
聽聽聽 聽 聽聽聽 聽聽聽 for(x in oTwoFields){
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 var field = form[oTwoFields[x][0]];
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 var secondField = form[oTwoFields[x][2]("secondProperty")];
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 if(field.type=="text"||field.type=="textarea"||field.type=="select-one"||field.type=="radio"||field.type=="password"){
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 var value;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 var secondValue;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 if(field.type=="select-one"){
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 var si = field.selectedIndex;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 value = field.options[si].value;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 secondValue = secondField.options[si].value;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 }else{
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 value=field.value;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 secondValue = secondField.value;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 }
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 if(value!=secondValue){
聽聽聽 聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 if(i==0){
聽聽聽 聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 focusField = field;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 }
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 fields[i++]=oTwoFields[x][1];
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 bValid = flase;
聽聽聽 聽 聽聽聽 聽聽聽 聽聽聽 }
聽聽聽 聽 聽聽聽 聽聽聽 }
聽聽聽 聽 聽聽聽 }
聽聽聽 聽 聽聽聽 if(fiels.length > 0){
聽聽聽 聽 聽聽聽 聽聽聽 focusFiled.focus();
聽聽聽 聽 聽聽聽 聽聽聽 alert(fields.join('\n'));
聽聽聽 聽 聽聽聽 聽聽聽 }
聽聽聽 聽 聽聽聽 return bValid;
聽聽聽 聽
聽聽聽 聽 ]]>
聽聽聽 聽

聽聽聽 聽
聽聽聽
鐒跺悗浣跨敤鐨勬椂鍊欏氨鍜屽叾浠栨病浠涔堜袱鏍風(fēng)殑浜?jiǎn)锛?xì)
聽聽聽 聽聽聽 

聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 secondProperty
聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 newPassword2
聽聽聽 聽聽聽 聽聽聽 聽聽聽

聽聽聽 聽聽聽 聽聽聽

聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽 聽聽聽
聽聽聽 聽聽聽 聽聽聽

聽聽聽 聽聽聽



娉ㄦ剰榪欎釜鍦版柟
聽聽聽 聽聽聽 聽聽聽 聽聽聽 
聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 secondProperty
聽聽聽 聽聽聽 聽聽聽 聽聽聽 聽聽聽 newPassword2
聽聽聽 聽聽聽 聽聽聽 聽聽聽

灝辨槸鎴戜滑鍦╦ava綾諱腑璇誨彇鐨勫彉閲忥紝瀹冧唬琛ㄧ殑鏄彟澶栫殑涓涓煙銆?br> 鍦↗SP涓殑浣跨敤灝變笉鍐嶈鏄庝簡(jiǎn)錛屽ぇ鍔熷憡鎴?)銆?br>



qiyadeng 2005-10-31 18:00 鍙戣〃璇勮
]]>
鐢ˋXIS寮濮媁ebService涔嬭緗?/title><link>http://m.tkk7.com/qiyadeng/articles/15215.html</link><dc:creator>qiyadeng</dc:creator><author>qiyadeng</author><pubDate>Tue, 11 Oct 2005 02:14:00 GMT</pubDate><guid>http://m.tkk7.com/qiyadeng/articles/15215.html</guid><wfw:comment>http://m.tkk7.com/qiyadeng/comments/15215.html</wfw:comment><comments>http://m.tkk7.com/qiyadeng/articles/15215.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/qiyadeng/comments/commentRss/15215.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/qiyadeng/services/trackbacks/15215.html</trackback:ping><description><![CDATA[<P>鐢ˋXIS寮濮媁ebService涔嬭緗?BR><A >http://ws.apache.org/axis/java/install.html</A><BR><A >http://www.chinaunix.net/jh/13/620370.html</A><BR>1.鐩稿叧鏂囦歡鍏ㄩ儴涓嬭澆濂斤細(xì)<BR>涓昏鏂囦歡錛?BR>axis-bin-1_2_1.zip 鐩墠鏈鏂扮殑<A >http://apache.justdn.org/ws/axis/1_2_1/</A><BR>渚濊禆鏂囦歡錛?BR>a.mail.jar 涓嬭澆鍦板潃:http://java.sun.com/products/javamail <BR>b.activation.jar 涓嬭澆鍦板潃:http://java.sun.com/products/javabeans/glasgow/jaf.html <BR>c.xerces.jar 涓嬭澆鍦板潃:http://xml.apache.org/xerces-j/index.html 1.4.4鐗堟湰<BR>d.xmlsec-1.2.1.jar 涓嬭澆鍦板潃:http://xml.apache.org/security/</P> <P>2.鐩稿叧璁劇疆<BR>a.鎶婁笂闈㈡彁鍒扮殑a,b,c,d鍥涗釜鍖呮嫹璐濆埌<CATALINA_HOME>/common/lib鐩綍涓?BR>b.鎶奱xis鐩綍涓嬬殑WEB-INF/lib鐩綍涓嬬殑鏂囦歡鍏ㄩ儴鎷瘋礉鍒?lt;CATALINA_HOME>/common/lib鐩綍涓?BR>c.鎶奐AVA_HOME/lib/tools.jar鎷瘋礉鍒?lt;CATALINA_HOME>/common/lib鐩綍涓?/P> <P>榪欐牱灝卞簲璇K浜?</P><img src ="http://m.tkk7.com/qiyadeng/aggbug/15215.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/qiyadeng/" target="_blank">qiyadeng</a> 2005-10-11 10:14 <a href="http://m.tkk7.com/qiyadeng/articles/15215.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Tomcat涓厤緗甅ySQL榪炴帴姹?/title><link>http://m.tkk7.com/qiyadeng/articles/15214.html</link><dc:creator>qiyadeng</dc:creator><author>qiyadeng</author><pubDate>Tue, 11 Oct 2005 02:13:00 GMT</pubDate><guid>http://m.tkk7.com/qiyadeng/articles/15214.html</guid><wfw:comment>http://m.tkk7.com/qiyadeng/comments/15214.html</wfw:comment><comments>http://m.tkk7.com/qiyadeng/articles/15214.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/qiyadeng/comments/commentRss/15214.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/qiyadeng/services/trackbacks/15214.html</trackback:ping><description><![CDATA[<P>1.鎶婇┍鍔ㄦ嫹璐濆埌%TOMCAT_HOME%/common/lib鐩綍涓?BR>2.鏂板緩鏁版嵁搴撹〃錛屽茍鍚戣〃涓坊鍔犺褰?BR></P> <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"><SPAN style="COLOR: #008080">1</SPAN><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">use</SPAN><SPAN style="COLOR: #000000"> test;<BR></SPAN><SPAN style="COLOR: #008080">2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top> </SPAN><SPAN style="COLOR: #0000ff">create</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">table</SPAN><SPAN style="COLOR: #000000"> testdata (<BR></SPAN><SPAN style="COLOR: #008080">3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>        id </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #808080">not</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000"> auto_increment </SPAN><SPAN style="COLOR: #0000ff">primary</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">key</SPAN><SPAN style="COLOR: #000000">,<BR></SPAN><SPAN style="COLOR: #008080">4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>        foo </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">varchar</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">25</SPAN><SPAN style="COLOR: #000000">), <BR></SPAN><SPAN style="COLOR: #008080">5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>        bar </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #000000">int</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">insert</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">into</SPAN><SPAN style="COLOR: #000000"> testdata </SPAN><SPAN style="COLOR: #0000ff">values</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #ff0000">hello</SPAN><SPAN style="COLOR: #ff0000">'</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="FONT-WEIGHT: bold; COLOR: #800000">12345</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV> <P><BR>3.鍦?TOMCAT_HOME%/config/server.xml鏂囦歡涓姞鍏ュ涓嬩竴孌甸厤緗俊鎭?鍦?lt;/Host>涔嬪墠)<BR></P> <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"><SPAN style="COLOR: #008080"> 1</SPAN><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">        </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000">鏁版嵁搴撹繛鎺ユ睜閰嶇疆</SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000">path:Your webApp directory</SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">Context </SPAN><SPAN style="COLOR: #ff0000">path</SPAN><SPAN style="COLOR: #0000ff">="/WS4Motel"</SPAN><SPAN style="COLOR: #ff0000"> docBase</SPAN><SPAN style="COLOR: #0000ff">="WS4Motel"</SPAN><SPAN style="COLOR: #ff0000"><BR></SPAN><SPAN style="COLOR: #008080"> 4</SPAN><SPAN style="COLOR: #ff0000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>        debug</SPAN><SPAN style="COLOR: #0000ff">="5"</SPAN><SPAN style="COLOR: #ff0000"> reloadable</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #ff0000"> crossContext</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080"> 6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000"> maxActive: Maximum number of dB connections in pool. Make sure you<BR></SPAN><SPAN style="COLOR: #008080"> 7</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         configure your mysqld max_connections large enough to handle<BR></SPAN><SPAN style="COLOR: #008080"> 8</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         all of your db connections. Set to 0 for no limit.<BR></SPAN><SPAN style="COLOR: #008080"> 9</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         </SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000"> maxIdle: Maximum number of idle dB connections to retain in pool.<BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         Set to -1 for no limit.  See also the DBCP documentation on this<BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         and the minEvictableIdleTimeMillis configuration parameter.<BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         </SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000"> maxWait: Maximum time to wait for a dB connection to become available<BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         in ms, in this example 10 seconds. An Exception is thrown if<BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         this timeout is exceeded.  Set to -1 to wait indefinitely.<BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         </SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">20</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">21</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000"> username and password: MySQL dB username and password for dB connections  </SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">22</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">23</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000"> driverClassName: Class name for the old mm.mysql JDBC driver is<BR></SPAN><SPAN style="COLOR: #008080">24</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         org.gjt.mm.mysql.Driver - we recommend using Connector/J though.<BR></SPAN><SPAN style="COLOR: #008080">25</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         Class name for the official MySQL Connector/J driver is com.mysql.jdbc.Driver.<BR></SPAN><SPAN style="COLOR: #008080">26</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         </SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">27</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    <BR></SPAN><SPAN style="COLOR: #008080">28</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000"> url: The JDBC connection url for connecting to your MySQL dB.<BR></SPAN><SPAN style="COLOR: #008080">29</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         The autoReconnect=true argument to the url makes sure that the<BR></SPAN><SPAN style="COLOR: #008080">30</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         mm.mysql JDBC Driver will automatically reconnect if mysqld closed the<BR></SPAN><SPAN style="COLOR: #008080">31</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         connection.  mysqld by default closes idle connections after 8 hours.<BR></SPAN><SPAN style="COLOR: #008080">32</SPAN><SPAN style="COLOR: #008000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>         </SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">33</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">34</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>  </SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">Resource </SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="jdbc/WS4Motel"</SPAN><SPAN style="COLOR: #ff0000"> auth</SPAN><SPAN style="COLOR: #0000ff">="Container"</SPAN><SPAN style="COLOR: #ff0000"> type</SPAN><SPAN style="COLOR: #0000ff">="javax.sql.DataSource"</SPAN><SPAN style="COLOR: #ff0000"><BR></SPAN><SPAN style="COLOR: #008080">35</SPAN><SPAN style="COLOR: #ff0000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>               maxActive</SPAN><SPAN style="COLOR: #0000ff">="100"</SPAN><SPAN style="COLOR: #ff0000"> maxIdle</SPAN><SPAN style="COLOR: #0000ff">="30"</SPAN><SPAN style="COLOR: #ff0000"> maxWait</SPAN><SPAN style="COLOR: #0000ff">="10000"</SPAN><SPAN style="COLOR: #ff0000"><BR></SPAN><SPAN style="COLOR: #008080">36</SPAN><SPAN style="COLOR: #ff0000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>               username</SPAN><SPAN style="COLOR: #0000ff">="root"</SPAN><SPAN style="COLOR: #ff0000"> password</SPAN><SPAN style="COLOR: #0000ff">="83072674"</SPAN><SPAN style="COLOR: #ff0000"> driverClassName</SPAN><SPAN style="COLOR: #0000ff">="com.mysql.jdbc.Driver"</SPAN><SPAN style="COLOR: #ff0000"><BR></SPAN><SPAN style="COLOR: #008080">37</SPAN><SPAN style="COLOR: #ff0000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>               url</SPAN><SPAN style="COLOR: #0000ff">="jdbc:mysql://localhost:3306/test?autoReconnect=true"</SPAN><SPAN style="COLOR: #0000ff">/></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">38</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">39</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">Context</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">40</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>        </SPAN><SPAN style="COLOR: #008000"><!--</SPAN><SPAN style="COLOR: #008000">鏁版嵁搴撹繛鎺ユ睜閰嶇疆</SPAN><SPAN style="COLOR: #008000">--></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">41</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV> <P> </P> <P> 4.鍐欎釜綆鍗曠▼搴忔祴璇曚笅錛?BR></P> <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"><SPAN style="COLOR: #008080"> 1</SPAN><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000"><%</SPAN><SPAN style="COLOR: #000000">@ taglib uri</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://java.sun.com/jsp/jstl/sql</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> prefix</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">sql</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">%></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><%</SPAN><SPAN style="COLOR: #000000">@ taglib uri</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://java.sun.com/jsp/jstl/core</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> prefix</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">c</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">%></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080"> 4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">sql:query var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">rs</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> dataSource</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">jdbc/TestDB</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>select id, foo, bar from testdata<BR></SPAN><SPAN style="COLOR: #008080"> 6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">sql:query</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080"> 8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">html</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"> 9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>  </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">head</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>    </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">title</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">DB Test</SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">title</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>  </SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">head</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>  </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">body</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>  </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">h2</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">Results</SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">h2</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>  <BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">c:forEach var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">row</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"> items</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${rs.rows}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_361_369_Open_Image onclick="this.style.display='none'; Codehighlighter1_361_369_Open_Text.style.display='none'; Codehighlighter1_361_369_Closed_Image.style.display='inline'; Codehighlighter1_361_369_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_361_369_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_361_369_Closed_Text.style.display='none'; Codehighlighter1_361_369_Open_Image.style.display='inline'; Codehighlighter1_361_369_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top>    Foo $</SPAN><SPAN id=Codehighlighter1_361_369_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_361_369_Open_Text><SPAN style="COLOR: #000000">{row.foo}</SPAN></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">br</SPAN><SPAN style="COLOR: #000000">/></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_385_393_Open_Image onclick="this.style.display='none'; Codehighlighter1_385_393_Open_Text.style.display='none'; Codehighlighter1_385_393_Closed_Image.style.display='inline'; Codehighlighter1_385_393_Closed_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_385_393_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_385_393_Closed_Text.style.display='none'; Codehighlighter1_385_393_Open_Image.style.display='inline'; Codehighlighter1_385_393_Open_Text.style.display='inline';" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align=top>    Bar $</SPAN><SPAN id=Codehighlighter1_385_393_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.tkk7.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_385_393_Open_Text><SPAN style="COLOR: #000000">{row.bar}</SPAN></SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">br</SPAN><SPAN style="COLOR: #000000">/></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">c:forEach</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">20</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">21</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top>  </SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">body</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">22</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000"></</SPAN><SPAN style="COLOR: #000000">html</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">23</SPAN><SPAN style="COLOR: #000000"><IMG src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV><img src ="http://m.tkk7.com/qiyadeng/aggbug/15214.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/qiyadeng/" target="_blank">qiyadeng</a> 2005-10-11 10:13 <a href="http://m.tkk7.com/qiyadeng/articles/15214.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鑾峰彇鏈湴涓繪満鐨凪AC鍦板潃 http://m.tkk7.com/qiyadeng/articles/14625.htmlqiyadengqiyadengSat, 01 Oct 2005 15:24:00 GMThttp://m.tkk7.com/qiyadeng/articles/14625.htmlhttp://m.tkk7.com/qiyadeng/comments/14625.htmlhttp://m.tkk7.com/qiyadeng/articles/14625.html#Feedback0http://m.tkk7.com/qiyadeng/comments/commentRss/14625.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/14625.html
 1/*
 2 FileName:MACHomework.java
 3 Author:嫻佹氮灝忓瓙
 4 Date:2004-7-5
 5 E-mail:qiyadeng@hotmail.com
 6 Purpose:鑾峰彇鏈湴涓繪満鐨凪AC鍦板潃
 7 */

 8import java.io.*;
 9import java.util.*;
10
11public class Main {
12    static private final int MACLength = 18;
13
14    public static void main(String args[]) {
15        System.out.print("鏈満鐨勭墿鐞嗗湴鍧鏄細(xì)");
16        System.out.println(getMACAddress());
17    }

18
19    static public String getMACAddress() {
20        SysCommand syscmd = new SysCommand();
21        //緋葷粺鍛戒護(hù)
22        String cmd = "cmd.exe /c ipconfig/all";
23        Vector result;
24        result = syscmd.execute(cmd);
25        return getCmdStr(result.toString());
26    }

27
28    static public String getCmdStr(String outstr) {
29        String find = "Physical Address. . . . . . . . . :";
30        int findIndex = outstr.indexOf(find);
31        if (findIndex == -1{
32            return "鏈煡閿欒錛?/SPAN>";
33        }
 else {
34            return outstr.substring(findIndex + find.length() + 1, findIndex
35                    + find.length() + MACLength);
36        }

37    }

38}

39
40//SysCommand綾?/SPAN>
41class SysCommand {
42    Process p;
43
44    public Vector execute(String cmd) {
45        try {
46            Start(cmd);
47            Vector vResult = new Vector();
48            DataInputStream in = new DataInputStream(p.getInputStream());
49            BufferedReader myReader = new BufferedReader(new InputStreamReader(
50                    in));
51            String line;
52            do {
53                line = myReader.readLine();
54                if (line == null{
55                    break;
56                }
 else {
57                    vResult.addElement(line);
58                }

59            }
 while (true);
60            myReader.close();
61            return vResult;
62        }
 catch (Exception e) {
63            return null;
64
65        }

66
67    }

68
69    public void Start(String cmd) {
70        try {
71            if (p != null{
72                kill();
73            }

74            Runtime sys = Runtime.getRuntime();
75            p = sys.exec(cmd);
76
77        }
 catch (Exception e) {
78
79        }

80    }

81
82    public void kill() {
83        if (p != null{
84            p.destroy();
85            p = null;
86        }

87    }

88
89}

90


qiyadeng 2005-10-01 23:24 鍙戣〃璇勮
]]>
JSP涓枃闂http://m.tkk7.com/qiyadeng/articles/14141.htmlqiyadengqiyadengMon, 26 Sep 2005 12:55:00 GMThttp://m.tkk7.com/qiyadeng/articles/14141.htmlhttp://m.tkk7.com/qiyadeng/comments/14141.htmlhttp://m.tkk7.com/qiyadeng/articles/14141.html#Feedback2http://m.tkk7.com/qiyadeng/comments/commentRss/14141.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/14141.html涓銆丣SP欏甸潰鏄劇ず涔辯爜浜屻佽〃鍗曟彁浜や腑鏂囨椂鍑虹幇涔辯爜涓夈佹暟鎹簱榪?
澶у鍦↗SP鐨勫紑鍙戣繃紼嬩腑錛岀粡甯稿嚭鐜頒腑鏂囦貢鐮佺殑闂錛屽彲鑳戒竴鑷沖洶鎵扮潃鎮(zhèn)紝鎴戠幇鍦ㄦ妸鎴戝湪JSP寮鍙戜腑閬囧埌鐨勪腑鏂囦貢鐮佺殑闂鍙?qiáng)瑙e啗_姙娉曞啓鍑烘潵渚涘ぇ瀹跺弬鑰冦?

涓銆丣SP欏甸潰鏄劇ず涔辯爜
涓嬮潰鐨勬樉紺洪〉闈?display.jsp)灝卞嚭鐜頒貢鐮侊細(xì)

<html> 
<head>
<title>JSP鐨勪腑鏂囧鐞?lt;/title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<%
out.print("JSP鐨勪腑鏂囧鐞?quot;);
%>
</body>
</html>

瀵逛笉鍚岀殑WEB鏈嶅姟鍣ㄥ拰涓嶅悓鐨凧DK鐗堟湰錛屽鐞嗙粨鏋滃氨涓嶄竴鏍楓傚師鍥狅細(xì)鏈嶅姟鍣ㄤ嬌鐢ㄧ殑緙栫爜鏂瑰紡涓嶅悓鍜屾祻瑙堝櫒瀵逛笉鍚岀殑瀛楃鏄劇ず緇撴灉涓嶅悓鑰屽鑷寸殑銆傝В鍐沖姙娉曪細(xì)鍦↗SP欏甸潰涓寚瀹氱紪鐮佹柟寮?gb2312),鍗沖湪欏甸潰鐨勭涓琛屽姞涓婏細(xì)<%@ page contentType="text/html; charset=gb2312"%>錛屽氨鍙互娑堥櫎涔辯爜浜?jiǎn)銆傚畬鏁撮〉闈㈠涓嬶細(xì)
<%@ page contentType="text/html; charset=gb2312"%> 
<html>
<head>
<title>JSP鐨勪腑鏂囧鐞?lt;/title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<%
out.print("JSP鐨勪腑鏂囧鐞?quot;);
%>
</body>
</html>

浜屻佽〃鍗曟彁浜や腑鏂囨椂鍑虹幇涔辯爜
涓嬮潰鏄竴涓彁浜ら〉闈?submit.jsp)錛屼唬鐮佸涓嬶細(xì)

<html> 
<head>
<title>JSP鐨勪腑鏂囧鐞?lt;/title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<form name="form1" method="post" action="process.jsp">
<div align="center">
<input type="text" name="name">
<input type="submit" name="Submit" value="Submit">
</div>
</form>
</body>
</html>

涓嬮潰鏄鐞嗛〉闈?process.jsp)浠g爜錛?
<%@ page contentType="text/html; charset=gb2312"%> 
<html>
<head>
<title>JSP鐨勪腑鏂囧鐞?lt;/title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<%=request.getParameter("name")%>
</body>
</html>

濡傛灉submit.jsp鎻愪氦鑻辨枃瀛楃鑳芥紜樉紺猴紝濡傛灉鎻愪氦涓枃鏃跺氨浼?xì)鍑虹庮C貢鐮併傚師鍥狅細(xì)嫻忚鍣ㄩ粯璁や嬌鐢║TF-8緙栫爜鏂瑰紡鏉ュ彂閫佽姹傦紝鑰孶TF-8鍜孏B2312緙栫爜鏂瑰紡琛ㄧず瀛楃鏃朵笉涓鏍鳳紝榪欐牱灝卞嚭鐜頒簡(jiǎn)涓嶈兘璇嗗埆瀛楃銆傝В鍐沖姙娉?閫氳繃request.setCharacterEncoding("gb2312")瀵硅姹傝繘琛岀粺涓緙栫爜錛屽氨瀹炵幇浜?jiǎn)涓枃鐨勬甯告槃·恒備慨鏀瑰悗鐨刾rocess.jsp浠g爜濡備笅錛?pre class="code"><%@ page contentType="text/html; charset=gb2312"%>
<%
request.seCharacterEncoding("gb2312");
%>
<html>
<head>
<title>JSP鐨勪腑鏂囧鐞?lt;/title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<%=request.getParameter("name")%>
</body>
</html>

涓夈佹暟鎹簱榪炴帴鍑虹幇涔辯爜
鍙娑夊強(qiáng)涓枃鐨勫湴鏂瑰叏閮ㄦ槸涔辯爜錛岃В鍐沖姙娉曪細(xì)鍦ㄦ暟鎹簱鐨勬暟鎹簱URL涓姞涓妘seUnicode=true&characterEncoding=GBK灝監(jiān)K浜?jiǎn)銆?

鍥涖佹暟鎹簱鐨勬樉紺轟貢鐮?
鍦╩ysql4.1.0涓?varchar綾誨瀷錛宼ext綾誨瀷灝變細(xì)鍑虹幇涓枃涔辯爜錛屽浜巚archar綾誨瀷鎶婂畠璁句負(fù)binary灞炴у氨鍙互瑙e喅涓枃闂錛屽浜巘ext綾誨瀷灝辮鐢ㄤ竴涓紪鐮佽漿鎹㈢被鏉ュ鐞嗭紝瀹炵幇濡備笅錛?

public class Convert { 
/** 鎶奍SO-8859-1鐮佽漿鎹㈡垚GB2312
*/
public static String ISOtoGB(String iso){
String gb;
try{
if(iso.equals("") || iso == null){
return "";
}
else{
iso = iso.trim();
gb = new String(iso.getBytes("ISO-8859-1"),"GB2312");
return gb;
}
}
catch(Exception e){
System.err.print("緙栫爜杞崲閿欒錛?quot;+e.getMessage());
return "";
}
}
}
鎶婂畠緙栬瘧鎴恈lass錛屽氨鍙互璋冪敤Convert綾葷殑闈?rùn)鎬佹柟娉旾SOtoGB()鏉ヨ漿鎹㈢紪鐮併?



qiyadeng 2005-09-26 20:55 鍙戣〃璇勮
]]>
鐮旂┒浜?jiǎn)涓?Struts-Layouthttp://m.tkk7.com/qiyadeng/articles/14131.htmlqiyadengqiyadengMon, 26 Sep 2005 09:42:00 GMThttp://m.tkk7.com/qiyadeng/articles/14131.htmlhttp://m.tkk7.com/qiyadeng/comments/14131.htmlhttp://m.tkk7.com/qiyadeng/articles/14131.html#Feedback1http://m.tkk7.com/qiyadeng/comments/commentRss/14131.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/14131.htmlhttp://struts.application-servers.com/index.html
涓.閰嶇疆錛?BR>http://struts.application-servers.com/install.html鏈夎緇嗙殑璇存槑
1.鎶婁笅闈㈢殑涓ょ鍔犲叆鍒皊truts-config.xml涓細(xì)
<action聽path="/sort"
聽type
="fr.improve.struts.taglib.layout.sort.SortAction"
聽scope
="request"
聽validate
="false">
action>
聽聽聽聽
<action聽path="/treeview"
聽type
="fr.improve.struts.taglib.layout.treeview.TreeviewAction"
聽scope
="request"
聽validate
="false">
action>

2.澶嶅埗struts-layout.jar鍒癢EB-INF/lib鐩綍涓?BR>3.鍦╳eb.xml鏂囦歡涓姞鍏ワ細(xì)
聽聽聽<jsp-config>
聽聽聽聽
<taglib>
聽聽聽聽聽
<taglib-uri>http://struts.application-servers.com/layouttaglib-uri>
聽聽聽聽聽
<taglib-location>/WEB-INF/struts-layout.tldtaglib-location>
聽聽聽聽
taglib>
聽聽聽
jsp-config>

4.鎶妔truts-layout.tld澶嶅埗鍒癢EB-INF鐩綍涓?BR>5.鎶妑esources鏂囦歡涓嬬殑config鏂囦歡鎷瘋礉鍒皐ebroot鐩綍涓嬶紝騫舵妸images鐩綍涓嬬殑鎵鏈夋枃浠舵嫹璐濆埌config鐩綍涓嬨?BR>浜?瀹炰緥榪愯錛?BR>鍐欎釜涓鑸殑jsp錛屽綋鐒跺搴旂殑Action,ActionForm宸茬粡鍐欏ソ浜?jiǎn)銆?BR>
<%@聽taglib聽uri="http://struts.application-servers.com/layout"聽prefix="layout"%>
<layout:html>
<layout:form聽action="/layout"聽styleClass="FORM">
聽聽
<layout:text聽key="search.name"聽property="name"聽styleClass="FIELD"/>
聽聽
<layout:text聽key="search.town"聽property="town"聽styleClass="FIELD"/>
聽聽
<layout:date聽key="serach.date"聽property="date"聽styleClass="LABEL"/>
聽聽
<layout:submit>
聽聽聽
<layout:message聽key="search.submit"/>
聽聽
layout:submit>
layout:form>
layout:html>
Snap1.bmp

qiyadeng 2005-09-26 17:42 鍙戣〃璇勮
]]>
iReport鐨勭畝鍗曢厤緗?/title><link>http://m.tkk7.com/qiyadeng/articles/13951.html</link><dc:creator>qiyadeng</dc:creator><author>qiyadeng</author><pubDate>Sat, 24 Sep 2005 13:26:00 GMT</pubDate><guid>http://m.tkk7.com/qiyadeng/articles/13951.html</guid><wfw:comment>http://m.tkk7.com/qiyadeng/comments/13951.html</wfw:comment><comments>http://m.tkk7.com/qiyadeng/articles/13951.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/qiyadeng/comments/commentRss/13951.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/qiyadeng/services/trackbacks/13951.html</trackback:ping><description><![CDATA[<P>iReport鏄釜濂戒笢瑗匡紝鐜板湪宸茬粡鍑烘潵浜?.5.1鐨勭増鏈簡(jiǎn)錛屼絾鏄繖涓伐鍏瘋櫧鐒跺ソ鐢紝浣嗘槸鍒濅嬌鐢ㄨ繕鏄細(xì)閬囧埌涓嶅皬鐨勯夯鐑?chǔ)銆?BR>涓嬮潰璇翠笅iReport鐨勫熀鏈厤緗細(xì)<BR>1.涓鑸敤iReport鐨勫悓蹇楅兘鏄嬌鐢↗ava鐨勶紝鎵鏈夐厤緗甁DK鐨勭幆澧冨氨涓嶈浜?jiǎn)^_^銆?/P> <P>2.褰撶劧闇瑕佸幓涓嬭澆iReport-0.5.1浜?jiǎn)锛岃寰棙q樼殑鎹庝笂涓猧TextAsian.jar錛岃繖鏄垜浠腑鍥戒漢闇瑕佺殑涓滆タ銆?BR>瑙e帇iReport-0.5.1錛屾妸\lib鐩綍涓嬬殑tinylaf.jar,mysql-connector-java-3.0.8-stable-bin.jar榪欎袱涓枃浠跺垹闄わ紝鐒跺悗鎶奿TextAsian.jar鎷瘋礉鍒癨lib鐩綍涓嬶紙tinylaf.jar鏂囦歡鍜宨TextAsian.jar鏈夊啿紿侊紝tinylaf.jar鏂囦歡鍒犱簡(jiǎn)涓嶄細(xì)褰卞搷浣跨敤錛屽彧鏄細(xì)褰卞搷涓鐐圭編瑙傦紝搴旇涓嶅叧緋諱笉澶_^錛夛紝鍏朵粬鐨勯厤緗兘涓嶉渶瑕佷簡(jiǎn)錛屽弻鍑昏鐩綍涓嬬殑iReport.bat榪愯iReport銆?/P> <P>3.鏂板緩涓涓枃妗g湅鐪嬶紝騫跺線鍏朵腑娣誨姞涓涓猄tatic Text錛屽啓涓婁腑鏂囷紝騫墮夋嫨濡備笅錛欶ont name:瀹嬩綋錛孭DF font name錛歋TSong-Light,PDF Encoding:UniGB-UCS2-H(Chinese Simplified)榪欎笁欏瑰繀淇慨鏀癸紝瑕佷笉涓枃浼?xì)鏈夐棶棰樸?BR><IMG height=380 alt=iReport1.jpg src="http://m.tkk7.com/images/blogjava_net/qiyadeng/j2ee/iReport/iReport1.jpg" width=370 border=0></P> <P>4.璁劇疆 DataSource--Connections/DataSource騫舵柊寤猴紝mysql璁劇疆濡備笅,騫惰鎶婁綘鐨勯┍鍔ㄦ嫹璐濆埌\lib鐩綍涓嬶紝璁板緱涓婇潰鍒犱簡(jiǎn)涓猰ysql-connector-java-3.0.8-stable-bin.jar涓滆タ鍚楋紵榪欎釜涓滆タ涓嶇煡閬撲負(fù)浠涔堜篃涓嶈兘鐢紝榪樻槸鐢╩ysql-connector-java-3.1.10-bin.jar銆?BR><IMG height=415 alt=iReport2.jpg src="http://m.tkk7.com/images/blogjava_net/qiyadeng/j2ee/iReport/iReport2.jpg" width=403 border=0></P> <P>5.閲嶆柊鍚姩iReport錛屽啀鎵撳紑Connections/DataSource嫻嬭瘯涓嬶紝搴旇浼?xì)鎻惤C轟綘鎴愬姛鐨勩傜劧鍚庨夋嫨鑿滃崟builder-set active connection.榪欐牱灝卞彲浠ヤ嬌鐢ㄤ簡(jiǎn)SQL璇彞浜?jiǎn)銆傞夋嫨鑿滃崟View-Report query,鍐欎笂鍙ョ畝鍗曠殑SQL璇彞錛屼笅闈㈠氨浼?xì)鏄窘C哄嚭瀛楁銆?BR><IMG height=500 alt=iReport3.jpg src="http://m.tkk7.com/images/blogjava_net/qiyadeng/j2ee/iReport/iReport3.jpg" width=520 border=0></P> <P>6.閫夋嫨view-Report-field錛岀劧鍚庡啀娣誨姞涓狥ield鍒版姤琛ㄤ腑鎸夋彁紺烘搷浣滐紝鎻愰啋涓嬶紝娉ㄦ剰涓嬪瓧孌電殑綾誨瀷錛屼笉姝g‘鐨勮瘽浼?xì)鍑洪敊銆傚鏋滃惈鏈変腑闂殑璇濓紝澶勭悊鍚屼笂3銆?/P> <P>榪愯涓嬬湅涓嬫晥鏋?builder-Execute Report(using active conn))錛?/P> <P><IMG style="WIDTH: 685px; HEIGHT: 556px" height=733 alt=iReport4.jpg src="http://m.tkk7.com/images/blogjava_net/qiyadeng/j2ee/iReport/iReport4.jpg" width=1000 border=0></P><img src ="http://m.tkk7.com/qiyadeng/aggbug/13951.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/qiyadeng/" target="_blank">qiyadeng</a> 2005-09-24 21:26 <a href="http://m.tkk7.com/qiyadeng/articles/13951.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍦╳eb project涓嬌鐢╨og4jhttp://m.tkk7.com/qiyadeng/articles/13834.htmlqiyadengqiyadengFri, 23 Sep 2005 06:16:00 GMThttp://m.tkk7.com/qiyadeng/articles/13834.htmlhttp://m.tkk7.com/qiyadeng/comments/13834.htmlhttp://m.tkk7.com/qiyadeng/articles/13834.html#Feedback0http://m.tkk7.com/qiyadeng/comments/commentRss/13834.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/13834.html鍦╳eb project涓嬌鐢╨og4j

涓嬮潰鎴戜滑浠ュ湪tomcat涓ず鑼冩庝箞閰嶇疆鍜屼嬌鐢╨og4j

鐜璁劇疆錛氱敤榪噒omcat鐨勯兘鐭ラ亾錛屽簲璇ユ妸log4j.jar鏂囦歡鎷瘋礉鍒?TOMCAT_HOME%\common\lib涓?BR>緙栬緫servlet:

 1package my.scwcd;
 2
 3
 4import javax.servlet.ServletException;
 5import javax.servlet.http.HttpServlet;
 6
 7import org.apache.log4j.PropertyConfigurator;
 8
 9public class Log4jInit extends HttpServlet {
10
11 public Log4jInit() {
12  super();
13 }

14
15 public void destroy() {
16  super.destroy(); // Just puts "destroy" string in log
17 }

18
19 public void init() throws ServletException {
20  String path = getServletContext().getRealPath("/");
21  
22  String file = getInitParameter("log4j");
23  if(file != null){
24   PropertyConfigurator.configure(path+file);
25  }

26  
27 }

28
29}

30
31


騫跺湪web.xml涓姞鍏ュ涓嬮厤緗細(xì)

 1  <servlet>
 2    <servlet-name>Log4jInit</servlet-name>
 3    <servlet-class>my.scwcd.Log4jInit</servlet-class>
 4    <init-param>
 5     <param-name>log4j</param-name>
 6     <param-value>WEB-INF\log4j.properties</param-value>
 7    </init-param>
 8    <load-on-startup>1</load-on-startup>
 9  </servlet>
10


娉ㄦ剰涓婇潰<param-value>涓殑"\"鍦╨inux瑕佸啓鎴?/"銆?BR>榪樻湁鍔犱笂log4j.properties鏂囦歡鍦╓EB-INF鐩綍涓?BR>

log4j.rootLogger=INFO, A1 , R
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=log4j.log
log4j.appender.R.MaxFileSize=100KB
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n

 

涓嬮潰鍐欎簡(jiǎn)涓や釜嫻嬭瘯鐨勭▼搴忥細(xì)
servlet Test.java涓細(xì)

 1 public void doGet(HttpServletRequest request, HttpServletResponse response)
 2   throws ServletException, IOException {
 3
 4  response.setContentType("text/html");
 5  PrintWriter out = response.getWriter();
 6  Logger logger = Logger.getLogger(Test.class);
 7  logger.info("Test use Logging for Servlet");
 8  out.println("<h1>Success<h1>");
 9  out.flush();
10  out.close();
11 }

12
13


JSP temp.jsp涓細(xì)

1   <%
2    response.setContentType("text/html");
3  Logger logger = Logger.getLogger("temp.jsp");
4  logger.info("Test use Logging for JSP");
5  out.println("<h1>Success<h1>");
6   %>
7


榪欐牱鍦?TOMCAT_HOME%\bin鐩綍涓嬩細(xì)浜х敓log4j.log鐨勬枃浠訛紝榪欏氨鏄棩蹇楁枃浠躲?/P>

qiyadeng 2005-09-23 14:16 鍙戣〃璇勮
]]>
鍦ㄥ簲鐢ㄧ▼搴忎腑浣跨敤log4jhttp://m.tkk7.com/qiyadeng/articles/13819.htmlqiyadengqiyadengFri, 23 Sep 2005 03:15:00 GMThttp://m.tkk7.com/qiyadeng/articles/13819.htmlhttp://m.tkk7.com/qiyadeng/comments/13819.htmlhttp://m.tkk7.com/qiyadeng/articles/13819.html#Feedback0http://m.tkk7.com/qiyadeng/comments/commentRss/13819.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/13819.html1銆佸湪搴旂敤紼嬪簭涓嬌鐢╨og4j
2銆佹妸log4j-*.*jar鏀懼叆CLASSPATH鍙橀噺涓?BR>緙栬緫濡備笅綆鍗昷ava鏂囦歡錛?BR>

 1package logging;
 2import org.apache.log4j.Logger;
 3import org.apache.log4j.PropertyConfigurator;
 4
 5public class TestLog4j {
 6
 7 static Logger logger = Logger.getLogger(TestLog4j.class);
 8 
 9 public static void main(String args[]){
10  PropertyConfigurator.configure("log4j.properties");
11  logger.info("Hello World");
12  logger.error("Hello World");
13  logger.warn("Hello World");
14  logger.debug("Hello World");
15 }

16}

17
18


鏂板緩涓涓厤緗枃浠秎og4j.properties錛?PRE class=code>
log4j.rootLogger=WARN, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
#log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
# Print the date in ISO 8601 format
log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
# Print only messages of level WARN or above in the package com.foo.
log4j.logger.com.foo=WARN

緙栬瘧騫惰繍琛孴estLog4j浼?xì)鍦ㄧ洰褰曚笅鐢熸垚涓涓猠xample.log鐨勬枃浠訛紝灞忓箷涔熶細(xì)杈撳嚭淇℃伅錛岃繖璇佹槑宸茬粡浣犲凡緇忔垚鍔熶簡(jiǎn)絎竴姝ャ?BR>涓嬮潰瑙i噴涓嬭繖浜涢厤緗枃浠?BR>
log4j.rootLogger = [ level ], appendName1, appendName2, 鈥ppendNameN銆傚悓涓涓褰曞櫒鍙湁澶氫釜杈撳嚭绔?BR>PS錛歭evel鐨勭駭鍒紙姝ょ駭鍒彲浠ヨ嚜瀹氫箟錛岀郴緇熼粯璁ゆ彁渚涗簡(jiǎn)浠ヤ笅綰у埆錛?BR>debug//璋冭瘯淇℃伅
info//涓鑸俊鎭?BR>warn//璀﹀憡淇℃伅
error//閿欒淇℃伅
fatal//鑷村懡閿欒淇℃伅
涓婇潰鍒楀嚭鐨勫氨鏄墍璋搇og4j鐨勮緭鍑虹駭鍒紝log4j寤鴻鍙嬌鐢?涓駭鍒紝瀹冧滑浠庝笂鍒頒笅鍒嗗埆涓篍RROR銆乄ARN銆両NFO銆丏EBUG錛屽亣璁句綘瀹氫箟鐨勭駭鍒槸info錛岄偅涔坋rror鍜寃arn鐨勬棩蹇楀彲浠ユ樉紺鴻屾瘮浠栦綆鐨刣ebug淇℃伅灝變笉鏄劇ず浜?jiǎn)銆?
log4j.appender.appenderName = fully.qualified.name.of.appender.class銆俵og4j鎻愪緵浜?jiǎn)浠ヤ笅鍑牽U嶅父鐢ㄧ殑杈撳嚭鐩殑鍦幫細(xì)
org.apache.log4j.ConsoleAppender錛屽皢鏃ュ織淇℃伅杈撳嚭鍒版帶鍒跺彴
org.apache.log4j.FileAppender錛屽皢鏃ュ織淇℃伅杈撳嚭鍒頒竴涓枃浠?BR>org.apache.log4j.DailyRollingFileAppender錛屽皢鏃ュ織淇℃伅杈撳嚭鍒頒竴涓紝騫朵笖姣忓ぉ杈撳嚭鍒頒竴涓柊鐨勬棩蹇楁枃浠?BR>org.apache.log4j.RollingFileAppender錛屽皢鏃ュ織淇℃伅杈撳嚭鍒頒竴涓枃浠訛紝閫氳繃鎸囧畾鏂囦歡鐨勭殑灝哄錛屽綋鏂囦歡澶у皬鍒拌揪鎸囧畾灝哄鐨勬椂鍊欎細(xì)鑷姩鎶婃枃浠舵敼鍚嶏紝濡傚悕涓篹xample.log鐨勬枃浠朵細(xì)鏀瑰悕涓?example.log.1錛屽悓鏃朵駭鐢熶竴涓柊鐨別xample.log鏂囦歡銆傚鏋滄柊鐨勬枃浠跺啀嬈¤揪鍒版寚瀹氬昂瀵革紝鍙堜細(xì)鑷姩鎶婃枃浠舵敼鍚嶄負(fù) example.log.2錛屽悓鏃朵駭鐢熶竴涓猠xample.log鏂囦歡銆備緷姝ょ被鎺紝鐩村埌example.log. MaxBackupIndex錛?MaxBackupIndex鐨勫煎彲鍦ㄩ厤緗枃浠朵腑瀹氫箟銆?BR>org.apache.log4j.WriterAppender錛屽皢鏃ュ織淇℃伅浠ユ祦鏍煎紡鍙戦佸埌浠繪剰鎸囧畾鐨勫湴鏂廣?BR>org.apache.log4j.jdbc.JDBCAppender錛岄氳繃JDBC鎶婃棩蹇椾俊鎭緭鍑哄埌鏁版嵁搴撲腑銆?BR>
Log4j鎻愪緵浜?jiǎn)涓涓嬪嚑縐嶅竷灞錛?BR>org.apache.log4j.HTMLLayout錛屼互HTML琛ㄦ牸褰㈠紡甯冨眬
org.apache.log4j.PatternLayout錛屽彲浠ョ伒媧誨湴鎸囧畾甯冨眬妯″紡
org.apache.log4j.SimpleLayout錛屽寘鍚棩蹇椾俊鎭殑綰у埆鍜屼俊鎭瓧絎︿覆

瀹氫箟涓涓狿atternLayout甯冨眬鐨勮鍙ヤ負(fù)錛?BR>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1} - %m%n
PS錛欳onversionPattern鍙傛暟鐨勬牸寮忓惈涔?BR>鏍煎紡鍚?鍚箟
%c 杈撳嚭鏃ュ織淇℃伅鎵灞炵殑綾葷殑鍏ㄥ悕
%d 杈撳嚭鏃ュ織鏃墮棿鐐圭殑鏃ユ湡鎴栨椂闂達(dá)紝榛樿鏍煎紡涓篒SO8601錛屼篃鍙互鍦ㄥ叾鍚庢寚瀹氭牸寮忥紝姣斿錛?d{yyy-MM-dd HH:mm:ss }錛岃緭鍑虹被浼鹼細(xì)2002-10-18- 22錛?0錛?8
%f 杈撳嚭鏃ュ織淇℃伅鎵灞炵殑綾葷殑綾誨悕
%l 杈撳嚭鏃ュ織浜嬩歡鐨勫彂鐢熶綅緗紝鍗寵緭鍑烘棩蹇椾俊鎭殑璇彞澶勪簬瀹冩墍鍦ㄧ殑綾葷殑絎嚑琛?BR>%m 杈撳嚭浠g爜涓寚瀹氱殑淇℃伅錛屽log(message)涓殑message
%n 杈撳嚭涓涓洖杞︽崲琛岀錛學(xué)indows騫沖彴涓衡淺r\n鈥濓紝Unix騫沖彴涓衡淺n鈥?BR>%p 杈撳嚭浼樺厛綰э紝鍗矰EBUG錛孖NFO錛學(xué)ARN錛孍RROR錛孎ATAL銆傚鏋滄槸璋冪敤debug()杈撳嚭鐨勶紝鍒欎負(fù)DEBUG錛屼緷姝ょ被鎺?BR>%r 杈撳嚭鑷簲鐢ㄥ惎鍔ㄥ埌杈撳嚭璇ユ棩蹇椾俊鎭墍鑰楄垂鐨勬縐掓暟
%t 杈撳嚭浜х敓璇ユ棩蹇椾簨浠剁殑綰跨▼鍚?BR>
鍙﹀寰堝ソ鐨勫涔?fàn)绗旇畮图?xì)
http://www.sentom.net/list.asp?id=59
http://www.sentom.net/list.asp?id=60
http://www.sentom.net/list.asp?id=61



qiyadeng 2005-09-23 11:15 鍙戣〃璇勮
]]>
鐢╦ava鍐欎釜MD5鍔犲瘑鐨勭被http://m.tkk7.com/qiyadeng/articles/13578.htmlqiyadengqiyadengTue, 20 Sep 2005 13:24:00 GMThttp://m.tkk7.com/qiyadeng/articles/13578.htmlhttp://m.tkk7.com/qiyadeng/comments/13578.htmlhttp://m.tkk7.com/qiyadeng/articles/13578.html#Feedback0http://m.tkk7.com/qiyadeng/comments/commentRss/13578.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/13578.html

鐢變簬涓涓簲鐢紝鎴戦渶瑕佷竴涓狹D5綆楁硶鍔犲瘑鏁版嵁錛屾垜鏌ョ湅浜?jiǎn)缃戜笂涓浜涜祫鏂欙紝鍙戠幇鍏朵粬鐨勮璦閮芥槸瑕佽嚜宸卞疄鐜扮殑錛屼絾鏄疛ava灝卞緢綆鍗曪紝鍥犱負(fù)java涓殑綾誨凡緇忓鐞嗗ソ浜?jiǎn)锛岃屼笖榪樺彲浠ラ夊叾浠栫殑鍔犲瘑綆楁硶錛屽SHA錛屼笅闈㈠氨緇欎竴涓緥瀛?/p>

/*
 * Created on 2005-5-21
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.merrylin.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class MD5Class {

 public static String MD5Encrypt(String inStr) {
  MessageDigest md = null;
  String outStr = null;

  try {
   md = MessageDigest.getInstance("MD5");       //鍙互閫変腑鍏朵粬鐨勭畻娉曞SHA
   byte[] digest = md.digest(inStr.getBytes());       //榪斿洖鐨勬槸byet[]錛岃杞寲涓篠tring瀛樺偍姣旇緝鏂逛究
   outStr = bytetoString(digest);
  } catch (NoSuchAlgorithmException nsae) {
   nsae.printStackTrace();
  }

  return outStr;
 }

 public static String bytetoString(byte[] digest) {
  String str = "";
  String tempStr = "";

  for (int i = 1; i < digest.length; i++) {
   tempStr = (Integer.toHexString(digest[i] & 0xff));
   if (tempStr.length() == 1) {
    str = str + "0" + tempStr;
   } else {
    str = str + tempStr;
   }
  }

  return str.toLowerCase();
 }

}

綆鍗曞惂錛屽鏋滀綘鍙槸瑕佸簲鐢紝灝卞彲浠ヤ笉鐭ラ亾MD5鐨勭畻娉曚簡(jiǎn)錛屼絾鏄鎯崇煡閬撴洿澶氾紝鍙互鍙傜湅緗戜笂鐨勬簮鐮佹垨鏄?a >http://www.donews.net/qiyadeng/archive/2005/05/26/399340.aspx銆備絾鏄敞鎰廙D5鍔犲瘑綆楁硶錛岀牬瑙h繕鏄緢鍥伴毦錛岃櫧鐒舵姤閬撶О灞變笢澶у鐨勭帇灝忎簯鏁欐巿濂藉儚鏄凡緇忓鎵懼埌浜?jiǎn)鐮磋В鐨勬栆?guī)硶銆?/font>



qiyadeng 2005-09-20 21:24 鍙戣〃璇勮
]]>
JBoss閰嶇疆Mysql榪炴帴姹?/title><link>http://m.tkk7.com/qiyadeng/articles/13577.html</link><dc:creator>qiyadeng</dc:creator><author>qiyadeng</author><pubDate>Tue, 20 Sep 2005 13:23:00 GMT</pubDate><guid>http://m.tkk7.com/qiyadeng/articles/13577.html</guid><wfw:comment>http://m.tkk7.com/qiyadeng/comments/13577.html</wfw:comment><comments>http://m.tkk7.com/qiyadeng/articles/13577.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/qiyadeng/comments/commentRss/13577.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/qiyadeng/services/trackbacks/13577.html</trackback:ping><description><![CDATA[<div>瀵逛簬jsp鐨剋eb紼嬪簭鏉ヨ錛岄厤緗繛鎺ユ睜鏄繀涓嶅彲灝戠殑銆侸Boss閰嶇疆MySql鐨勮繛鎺ユ睜錛屽彲浠ユ煡鐪嬪畼鏂規(guī)枃妗o紝鍦板潃涓猴細(xì)<a >http://docs.jboss.org/jbossas/getting_started/v4/html/db.html</a>銆?/div><div>鎴戣繖閲岀殑閰嶇疆鍒嗕負(fù)浠ヤ笅鍑犳錛?/div><div>絎竴姝ワ細(xì)浠巎boss-4.0.2\docs\examples\jca鐩綍涓嬬殑mysql-ds.xml澶嶅埗鏂囦歡鍒癉:\jboss-4.0.2\server\default\deploy鐩綍涓嬪茍緙栬緫濡備笅錛?/div><pre class="code"><div><?xml version="1.0" encoding="UTF-8"?></div><div><!-- $Id: mysql-ds.xml,v 1.3.2.1 2004/12/01 11:46:00 schrouf Exp $ --><br/><!--  Datasource config for MySQL using 3.0.9 available from:<br/><a >http://www.mysql.com/downloads/api-jdbc-stable.html</a><br/>--></div><div><datasources><br/>  <local-tx-datasource><br/>    <jndi-name>MySqlDS</jndi-name><br/>    <connection-url>jdbc:mysql://localhost:3306/test</connection-url><br/>    <driver-class>com.mysql.jdbc.Driver</driver-class><br/>    <user-name>root</user-name><br/>    <password>root</password><br/>    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name><br/>    <!-- sql to call when connection is created<br/>    <new-connection-sql>some arbitrary sql</new-connection-sql><br/>      --><br/>    <!-- sql to call on an existing pooled connection when it is obtained from pool <br/>    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql><br/>      --></div><div>    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --><br/>    <metadata><br/>       <type-mapping>mySQL</type-mapping><br/>    </metadata><br/>  </local-tx-datasource><br/></datasources></div></pre><div>絎簩姝ワ細(xì)緙栬緫jboss-4.0.2\server\default\conf涓嬬殑涓変釜鏂囦歡錛歴tandardjbosscmp-jdbc.xml錛宻tandardjaws.xml錛宭ogin-config.xml</div><div>standardjbosscmp-jdbc.xml淇敼閮ㄥ垎錛?/div><pre class="code"><div>      <datasource>java:/MySqltDS</datasource><br/>      <datasource-mapping>mySQL</datasource-mapping></div></pre><div>standardjaws.xml淇敼閮ㄥ垎錛?/div><pre class="code"><div>   <datasource>java:/MySqltDS</datasource><br/>   <type-mapping>mySQL</type-mapping></div></pre><div>login-config.xml淇敼閮ㄥ垎錛氾紙鍙互娣誨姞榪欎竴孌碉紝澶嶅埗涓孌佃繘琛屼慨鏀癸級(jí)</div><pre class="code"><div>    <application-policy name = "MySqlDbRealm"><br/>       <authentication><br/>          <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"<br/>             flag = "required"><br/>             <module-option name = "principal">test</module-option><br/>             <module-option name = "userName">root</module-option><br/>             <module-option name = "password">root</module-option><br/>             <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option><br/>          </login-module><br/>       </authentication><br/>    </application-policy></div></pre><div></div><div>絎笁姝ワ細(xì)閲嶅惎jboss娌℃湁鍑虹幇寮傚父錛屽氨浼?xì)鏈夊涓嬫槃·哄Q岃瘉鏄庨厤緗紜細(xì)</div><div><IMG height=20 alt=pool.jpg src="http://m.tkk7.com/images/blogjava_net/qiyadeng/j2ee/pool.jpg" width=777 border=0></div><div>絎洓姝ワ細(xì)濡傛灉浣犺繕姝ユ斁蹇?jī)锛岀幇鍦ㄥ啓涓猻ervlet璇曡瘯鍚э細(xì)</div><pre class="code"><div>  response.setContentType("text/html;charset=gb2312");<br/>  PrintWriter out = response.getWriter();<br/>  try {<br/>   // Put your code here<br/>   Context cx  = new InitialContext();<br/>   Object obj = cx.lookup("java:/MySqlDS");<br/>   DataSource ds = (DataSource)obj;<br/>   Connection connect = ds.getConnection();<br/>   Statement stmt = connect.createStatement();<br/>   ResultSet rs = stmt.executeQuery("select * from customers");<br/>   while(rs.next()){<br/>    out.println(rs.getString("name"));<br/>   }<br/>  } catch (NamingException e) {<br/>   e.printStackTrace();<br/>  } catch(SQLException e1){<br/>   e1.printStackTrace();<br/>  }<br/>  out.flush();<br/>  out.close();</div></pre><img src ="http://m.tkk7.com/qiyadeng/aggbug/13577.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/qiyadeng/" target="_blank">qiyadeng</a> 2005-09-20 21:23 <a href="http://m.tkk7.com/qiyadeng/articles/13577.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>native2ascii--java鍥介檯鍖栧伐鍏?/title><link>http://m.tkk7.com/qiyadeng/articles/13576.html</link><dc:creator>qiyadeng</dc:creator><author>qiyadeng</author><pubDate>Tue, 20 Sep 2005 13:21:00 GMT</pubDate><guid>http://m.tkk7.com/qiyadeng/articles/13576.html</guid><wfw:comment>http://m.tkk7.com/qiyadeng/comments/13576.html</wfw:comment><comments>http://m.tkk7.com/qiyadeng/articles/13576.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/qiyadeng/comments/commentRss/13576.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/qiyadeng/services/trackbacks/13576.html</trackback:ping><description><![CDATA[<BR>native2ascii铏界劧鏄釜寰堝皬鐨勫伐鍏?浣嗘槸鐢ㄥ涓嶅皬.鍦ㄦ垜浠繖浜涢潪鑻辮鍥藉鐗瑰埆鏈夌敤,濡備竴浜汼trut鍜孞SF鐨勯厤緗枃浠?濡傛灉瑕佷嬌鐢ㄤ腑鏂囧氨蹇呴』瑕佺敤鍒拌宸ュ叿.<BR>濡備笅闈㈣繖鏍?浣跨敤璧鋒潵寰堟柟渚?<BR><PRE class=code>[root@localhost root]# native2ascii<BR>浣犲ソ涓栫晫!<BR>\u4f60\u597d\u4e16\u754c!<BR></PRE><BR>浣嗘槸鎴戝ソ鍍忓彂鐜扮偣闂,鎴戠敤eclipse(MyEclipse)緙栬緫瀹岀殑鏂囦歡,鐢ㄤ腑鏂囧啓鐨?灝辨病鏈夊姙娉曟潵杞崲,涓嶇煡閬撲粈涔堝師鍥?<BR>褰撶劧native2ascii榪樹笉鑷寵繖浜涚敤澶?灝辨槸鍦ㄥ弽緙栬瘧鍒漢鐨勭▼搴忎腑,涔熷彲浠ユ妸閭d簺Unicode杞寲鎴愪腑鏂?<BR><img src ="http://m.tkk7.com/qiyadeng/aggbug/13576.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/qiyadeng/" target="_blank">qiyadeng</a> 2005-09-20 21:21 <a href="http://m.tkk7.com/qiyadeng/articles/13576.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍦⊿ervlet鍜孞SP涓闂畐eb.xml璁劇疆鐨勫垵濮嬪弬鏁?/title><link>http://m.tkk7.com/qiyadeng/articles/13575.html</link><dc:creator>qiyadeng</dc:creator><author>qiyadeng</author><pubDate>Tue, 20 Sep 2005 13:20:00 GMT</pubDate><guid>http://m.tkk7.com/qiyadeng/articles/13575.html</guid><wfw:comment>http://m.tkk7.com/qiyadeng/comments/13575.html</wfw:comment><comments>http://m.tkk7.com/qiyadeng/articles/13575.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/qiyadeng/comments/commentRss/13575.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/qiyadeng/services/trackbacks/13575.html</trackback:ping><description><![CDATA[<p>鍦↗SP鍜孲ervlet涓湁鏃跺欓渶瑕佽鍙杦eb.xml鐨勫垵濮嬪寲鍙傛暟錛屾瘮濡傚彲浠ョ敤浜庤緗甁NDI鐨勬暟鎹簮鐨勫悕瀛椼備笅闈㈢畝鍗曚粙緇嶄笅鍦↗SP鍜孲ervlet涓庝箞璇誨彇web.xml鐨勫垵濮嬪寲鍙傛暟銆?/p><p>涓銆佸湪Servlet涓鍙栵細(xì)</p><p>鍦⊿ervlet涓竴鑸彲浠ョ敤ServletConfig瀵硅薄鐨刧etInitParameter鏂規(guī)硶鍘昏鍙栨寚瀹氱殑鍙傛暟鐨勫箋備婦涓緥瀛愶細(xì)</p><p>鏂板緩涓涓猄ervlet錛歊eadInitParameter.java</p><p>騫跺湪web.xml涓鍔犲涓嬮厤緗細(xì)</p><p></p><pre class="code">  <servlet><br/>    <servlet-name>ReadInitParameter</servlet-name><br/>    <servlet-class>com.test.ReadInitParameter</servlet-class><br/>    <init-param><br/>      <param-name>email</param-name><br/>      <param-value>qiyadeng@haha.com</param-value><br/>    </init-param><br/>    <init-param><br/>      <param-name>name</param-name><br/>      <param-value>qiyadeng</param-value><br/>    </init-param><br/>  </servlet></pre><br/>   <servletclass>com.test.ReadInitParameter</servlet-class>鏄痵ervlet鐨勫畬鏁磋礬寰勶紝鍖呮嫭鍖呭悕銆?p></p><p>閰嶇疆濂戒簡(jiǎn)web.xml錛岀幇鍦ㄥ彲浠ュ湪紼嬪簭涓鍙栧垵濮嬪寲鐨勫弬鏁頒簡(jiǎn)銆傚湪init(ServletConfig config)鏂規(guī)硶涓紶閫掍簡(jiǎn)涓涓猄ervletConfig鍙傛暟錛屽彲浠ヨ繖鏍瘋幏鍙栧垵濮嬪寲鍙傛暟錛?/p><p></p><pre class="code">  public void init(ServletConfig config) throws ServletException<br/>  {<br/>    super.init(config);<br/>    String email = config.getInitParameter("email");<br/>    String name = config.getInitParameter("name");<br/>  }</pre><br/>鍦ㄥ叾浠栫殑鏂規(guī)硶涓薄doGet(),doPost(),service()鏂規(guī)硶涓彲浠ョ敤getServeltConfig()鏂規(guī)硶寰楀埌涓涓猄ervetConfig瀵硅薄錛屽湪鍒╃敤璇ュ璞$殑getInitParameter()鏂規(guī)硶鍙栧埌瀵瑰簲鐨勫垵濮嬪寲鍙傛暟銆?p></p><p></p><pre class="code"><strong>  </strong>String email   = getServletConfig().getInitParameter<strong>("</strong>email<b>");<br/>  </b>String name= getServletConfig().getInitParameter<strong>("</strong>name<strong>");</strong></pre><p></p><p>浜屻佸湪JSP涓鍙栵細(xì)</p><p>鍦↗SP涓鍙栫殑鏂瑰紡鍜孲ervlet涓殑doGet(),doPost(),Service()鐨勬柟娉曚竴鏍鳳紝閮芥槸鐢盨ervletConfig瀵硅薄鏉ヨ鍙栫殑銆?/p><p></p><pre class="code">  <%<br/>    String zhutou = getServletConfig().getInitParameter("zhutou");<br/>    String zhutouname = getServletConfig().getInitParameter("zhutouname");</pre><br/>  %><p></p><p>浣嗘槸錛屽湪web.xml鐨勯厤緗渶瑕佹敞鎰忎竴涓?鏂板濡備笅錛?/p><p></p><pre class="code">  <servlet><br/>    <servlet-name>ReadInitParam</servlet-name><br/>    <jsp-file>ReadInitParam.jsp</jsp-file><br/>    <init-param><br/>      <param-name>zhutou</param-name><br/>      <param-value>zhutou@hotmail.com</param-value><br/>    </init-param><br/>    <init-param><br/>      <param-name>zhutouname</param-name><br/>      <param-value>zhutou</param-value><br/>    </init-param><br/>  </servlet></pre><p></p><p>鍦╯ervlet-mapping涓篃瑕侀厤緗ソ錛?/p><p></p><pre class="code">  <servlet-mapping><br/>    <servlet-name>ReadInitParam</servlet-name><br/>    <url-pattern>ReadInitParam.jsp</url-pattern><br/>  </servlet-mapping></pre><p></p><p>涓婇潰鐨凴eadInitParam.jsp鍑虹幇鐨勬爣絳鵑渶瑕乯sp鏂囦歡鐨勫叏閮ㄨ礬寰勩?/p><img src ="http://m.tkk7.com/qiyadeng/aggbug/13575.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/qiyadeng/" target="_blank">qiyadeng</a> 2005-09-20 21:20 <a href="http://m.tkk7.com/qiyadeng/articles/13575.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>web-app_2_2.xml(浠呬緵瀛︿範(fàn)鏂逛究) http://m.tkk7.com/qiyadeng/articles/13570.htmlqiyadengqiyadengTue, 20 Sep 2005 12:59:00 GMThttp://m.tkk7.com/qiyadeng/articles/13570.htmlhttp://m.tkk7.com/qiyadeng/comments/13570.htmlhttp://m.tkk7.com/qiyadeng/articles/13570.html#Feedback0http://m.tkk7.com/qiyadeng/comments/commentRss/13570.htmlhttp://m.tkk7.com/qiyadeng/services/trackbacks/13570.html闃呰鍏ㄦ枃

qiyadeng 2005-09-20 20:59 鍙戣〃璇勮
]]>
Struts鍥介檯鍖栨楠?/title><link>http://m.tkk7.com/qiyadeng/articles/13569.html</link><dc:creator>qiyadeng</dc:creator><author>qiyadeng</author><pubDate>Tue, 20 Sep 2005 12:56:00 GMT</pubDate><guid>http://m.tkk7.com/qiyadeng/articles/13569.html</guid><wfw:comment>http://m.tkk7.com/qiyadeng/comments/13569.html</wfw:comment><comments>http://m.tkk7.com/qiyadeng/articles/13569.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/qiyadeng/comments/commentRss/13569.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/qiyadeng/services/trackbacks/13569.html</trackback:ping><description><![CDATA[<p>瀵筍truts瀹炶鍥介檯鍖?br/>(1)璁劇疆瀛楃緙栫爜<br/>涓轟簡(jiǎn)淇濊瘉鍦ㄥ悓涓JSP欏甸潰鑳芥敮鎸佸縐嶈璦錛屽彲浠ュ皢鎵鏈塉SP欏甸潰鐨勫瓧絎︾紪鐮佺粺涓璁劇疆涓?quot;UTF-8"<br/></p><pre class="code"><%@ page contentType="text/html;charset=UTF-8" language="java"%></pre><br/>(2)瀵規(guī)枃鏈紝鎸夐挳錛屽浘鐗囧浗闄呭寲<br/>(3)鍒涘緩鑻辨枃錛屼腑鏂囪祫婧愭枃浠?br/>(4)瀵逛腑鏂囪祫婧愭枃浠惰繘琛岀紪鐮佽漿鎹?br/>鐢↗DK涓殑native2ascii宸ュ叿瀵逛腑鏂囪祫婧愯繘琛岃漿鎹?br/><pre class="code">native2ascii -encoding gb2312 applicaion_CN.properties application_CN.properties</pre><br/>(5)閲囩敤Servlet榪囨護(hù)鍣ㄨ緗姹傛暟鎹殑瀛楃緙栫爜<br/>娣誨姞濡備笅綾籗etCharacterEncodingFilter:<br/><pre class="code">package com.yourcompany.struts;<p></p><p>import java.io.IOException;</p><p>import javax.servlet.Filter;<br/>import javax.servlet.FilterChain;<br/>import javax.servlet.FilterConfig;<br/>import javax.servlet.ServletException;<br/>import javax.servlet.ServletRequest;<br/>import javax.servlet.ServletResponse;</p><p>public class SetCharacterEncodingFilter implements Filter {</p><p> public void init(FilterConfig arg0) throws ServletException {<br/> }</p><p> public void doFilter(ServletRequest request, ServletResponse response,<br/>   FilterChain chain) throws IOException, ServletException {<br/>  request.setCharacterEncoding("UTF-8");<br/>  chain.doFilter(request,response);</p><p> }</p><p> public void destroy() {<br/> }</p><p>}</p></pre><br/>騫跺湪web.xml涓坊鍔犲涓嬭緗細(xì)<br/>  <pre class="code"> <filter><br/>    <filter-name>Character Encoding</filter-name><br/>    <filter-class>com.yourcompany.struts.SetCharacterEncodingFilter</filter-class><br/>   </filter><br/>   <filter-mapping><br/>    <filter-name>Character Encoding</filter-name><br/>    <url-pattern>/*</url-pattern><br/>   </filter-mapping></pre><p></p><p><br/></p><img src ="http://m.tkk7.com/qiyadeng/aggbug/13569.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/qiyadeng/" target="_blank">qiyadeng</a> 2005-09-20 20:56 <a href="http://m.tkk7.com/qiyadeng/articles/13569.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://gxnnzk.com" target="_blank">亚洲爆乳大丰满无码专区</a>| <a href="http://zhaoav7.com" target="_blank">久久www免费人成看片</a>| <a href="http://koukoub.com" target="_blank">国产乱人免费视频</a>| <a href="http://jack-fx.com" target="_blank">亚洲综合小说另类图片动图</a>| <a href="http://luyifeile.com" target="_blank">37pao成人国产永久免费视频</a>| <a href="http://trio2003.com" target="_blank">亚洲精品无码成人AAA片</a>| <a href="http://625r.com" target="_blank">污网站免费在线观看</a>| <a href="http://4438xx21.com" target="_blank">日本特黄特黄刺激大片免费</a>| <a href="http://ynxxrh.com" target="_blank">亚洲日韩国产精品乱-久</a>| <a href="http://928288.com" target="_blank">99久久国产热无码精品免费</a>| <a href="http://sdsupuchem.com" target="_blank">777亚洲精品乱码久久久久久</a>| <a href="http://yulongfilm.com" target="_blank">久久精品免费观看</a>| <a href="http://www282pp.com" target="_blank">亚洲精品乱码久久久久久久久久久久</a>| <a href="http://wo93xyz.com" target="_blank">一个人免费观看视频在线中文</a>| <a href="http://fenglengqi.com" target="_blank">国产又大又粗又硬又长免费</a>| <a href="http://jisuanq.com" target="_blank">亚洲熟妇无码av另类vr影视 </a>| <a href="http://ynrygc.com" target="_blank">青青青国产色视频在线观看国产亚洲欧洲国产综合 </a>| <a href="http://lhtjdj.com" target="_blank">亚洲精品日韩一区二区小说</a>| <a href="http://dwj28.com" target="_blank">无码人妻久久一区二区三区免费丨</a>| <a href="http://jinguwj.com" target="_blank">亚洲综合一区二区精品久久</a>| <a href="http://038037.com" target="_blank">久久青青成人亚洲精品</a>| <a href="http://xxyy66.com" target="_blank">成年免费a级毛片免费看无码</a>| <a href="http://89kino.com" target="_blank">亚洲午夜福利精品久久</a>| <a href="http://xj47777.com" target="_blank">日日摸夜夜添夜夜免费视频</a>| <a href="http://bovch.com" target="_blank">亚洲精品色婷婷在线影院</a>| <a href="http://yygcui.com" target="_blank">免费人成大片在线观看播放</a>| <a href="http://cebeke.com" target="_blank">免费一级毛片在线播放</a>| <a href="http://8fue.com" target="_blank">黄页网站在线免费观看</a>| <a href="http://3334598.com" target="_blank">亚洲AV伊人久久青青草原</a>| <a href="http://nibayuan.com" target="_blank">曰批全过程免费视频观看免费软件</a>| <a href="http://18jko.com" target="_blank">国产一区二区三区在线观看免费</a>| <a href="http://www-887234.com" target="_blank">亚洲AV性色在线观看</a>| <a href="http://cebeke.com" target="_blank">成人永久免费福利视频网站</a>| <a href="http://ttvv55.com" target="_blank">亚洲av午夜国产精品无码中文字</a>| <a href="http://sdzhly.com" target="_blank">在线观看免费成人</a>| <a href="http://tqdrhj.com" target="_blank">免费在线观看亚洲</a>| <a href="http://moushengguigz.com" target="_blank">亚洲Av无码乱码在线播放</a>| <a href="http://nh-car.com" target="_blank">一个人晚上在线观看的免费视频</a>| <a href="http://by1687.com" target="_blank">亚洲精品国产精品乱码不卡√ </a>| <a href="http://av520av.com" target="_blank">老司机精品视频免费</a>| <a href="http://ai-xian.com" target="_blank">亚洲免费在线观看</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>