1: 在 struts1.2.7 中使用 mappingdispatchAction
?
parameter 中直接來定義的就是 METHOD 的 name ,
一個 /xxxx.do 用一個 <action mapping…/> 來定義比如
?
?
<action path=”/add”
parameter=”add”
type=”xxxextMappingdispatchAction”
>
<forward name=”success” path=”/addsuccess.jsp”/>
</acton>
?
<action path=”/edit”
parameter=”edit”
type=”xxxextMappingdispatchAction”
>
<forward name=”success” path=”/editsuccess.jsp”/>
</action>
看一下STRUTS的源代碼,其實實現就是java relection非常的簡單
??????? Exit TOAD Launch TOAD On the Login screen their should be an option to
> use 'SQL Net compatible Net8' Please check this
?
問題就解決了呵呵,可能是要求兼容以前的ORACLE的用法,現在去掉了就好了,沒有問題了
??????????????????????????????????????
??? <target name="deploy.selfcare" depends="compile">
???
??? <delete dir="${selfcare.web.dir}/WEB-INF/classes" failonerror="false" />
???
??? <delete dir="${selfcare.web.dir}/WEB-INF/lib" failonerror="false" />
???
??? <mkdir dir="${selfcare.web.dir}/WEB-INF/lib" />
???
??? <mkdir dir="${selfcare.web.dir}/WEB-INF/classes" />
?????? <copy todir="${selfcare.web.dir}/WEB-INF/classes">
??????
??? <fileset dir="${classes.main}" />
???
??? </copy>
?????? <copy todir="${selfcare.web.dir}/WEB-INF/lib" flatten="true">
??????
??? <fileset dir="${libs}" excludes="**/xdoclet*.jar"/>
???
??? </copy>
?????? <copy todir="${selfcare.web.dir}/WEB-INF/classes">
??????
??? <fileset dir="${src.main}" includes="**/*.xml, **/*.properties" />
???
??? </copy>
??? </target>
?
<property name="src.main" value="${basedir}/src" />
Property
就是定義常量
<target> 就是一個任務
<delete dir= 刪除一個目錄
<mkdir dir 家里目錄
<copt todir 就是拷貝到哪個目錄
? <fileset dir 就是從哪里拷貝
?
<target depends> 就是依賴別的任務
?
?
??? <target name="compile" depends="init">
??????? <mkdir dir="${classes.main}" />
??????? <javac srcdir="${src.main}" destdir="${classes.main}" debug="${debug}">
???????
??? <classpath refid="classpath.lib" />
??????? </javac>
???
??? <native2ascii src="${src.main}" dest="${classes.main}" includes="**/*.properties" />
???
<antcall target="enhance"/>
??? </target>
??? <target name="init" depends="clean">
???
??
??? <mkdir dir="${junit.report}"/>
???
??
??? <mkdir dir="${build.dir}"/>
</target>
?
??? <target name="enhance" >
?????? <copy todir="${classes.main}" >
??????
??? <fileset dir="${src.main}" >
??????????
??? <include name="**/*.jdo"/>
??????
??? </fileset>
???
??? </copy>
?????? <ant antfile="build-jdo.xml" target="enhance"/>
</target>
?
??? <path id="classpath.main">
???
??? <pathelement location="${classes.main}" />
??? </path>
Path
是類的路徑,指定當前編譯的類路徑
?
<taskdef name="ejbdoclet" classname="xdoclet.modules.ejb.EjbDocletTask" classpathref="xdoclet.jars" />
?
定義任務標簽,
頭標:JAVA-CODE STYLE-CODE TEMPLATE-->NEW JAVA FILES-->
/**
?* Copyright (c) 2001-2005 by ** Corporation
?*?? All rights reserved.
**/
作者版本:java ->code stype-->code templates-->Comment -->types
/**
?* @author Jianping Wang (aaa@aaa.com)
?* @version $$Id: ${file_name},v 1.1 ${date} ${time}Jianping Wang Exp $$
?* ${tags}
?*/
Static 變量對于改類所有的對象都是可見的,如果實在一個 JVM 里面,當然對于 WEB 來說,在一個 WEGLOIGC 的 server 上調試一個程序,相當于一個 JVM , STATIC 對于該類的任何實例都是可見的。
要是在應用程序里面,如果調試 2 個應用程序,那么這 2 個應用程序不會在一個 JVM 里面,那么 STATIC 各自維護各自的沒有任何聯系,除非是一個應用程序有多個窗口你才能看到 STATIC 變量的效果
?
?
寫這段文字的意思就是說: STATIC 與 JVM 的關系,有時間一定看看 JAVA 虛擬機這本書
摘要: 1 :單表添加過程 添加單表的過程非常簡單直接寫一個對象就可以,最關鍵的是處理主鍵,主鍵的 SEQUERCE 的生成,(不過還不太懂如何去配置 SEQUENCE 的生成) ... 閱讀全文java.io.InputStream is = Test.Class.GetResourceAsStream("test.template");
is? --->String? all = "sdfsdfsfd<
//replice <
String replace = "user:wjp";
RE r = new RE("<
r.subst(all,replace);
OK,you can get the replaced String ...
??????????????????????????????????????
asnchronized??在一個線程調用它之前必須先給它加
類修飾符
Public????????????????? 可以從其他類中訪問
obstract??????????????? 本類不能被實例化
final?????????????????? 不能再聲明子類
構造器修飾符
Public????????????????? 可以從所有的類中訪問
Protected?????????????? 只能從自己的類和它的子類中訪問
Private???????????????? 只能在本類中訪問
域修飾符
Public????????????????? 可以從所有的類中訪問
Protected?????????????? 只能從本類和它的子類中訪問
Private???????????????? 只能從本類中訪問它
Static????????????????? 對該類的所有實例只能有一個域值存在
transient?????????????? 不是一個對象持久狀態的一部份
Volatile??????????????? 可以被異步的線程所修改
final?????????????????? 必須對它賦予初值并且不能修改它
局部變量修飾符
final?????????????????? 必須對它賦予初值并且不能修改它
方法修飾符
Public????????????????? 可以從所有的類中訪問它
Protected?????????????? 只能從本類及其子類中訪問它
Private???????????????? 只能從本類中訪問它
abstract??????????????? 沒有方法體,屬于一個抽象類
final?????????????????? 子類不能覆蓋它
static????????????????? 被綁定于類本身而不是類的實例
native????????????????? 該方法由其他編程語言實現
asnchronized??????????? 在一個線程調用它之前必須先給它加
(1:)sitemesh.xml 文件好像默認只能放在web-inf下面,
不過我感覺肯定sitemesh提供其他的loader方式,在類包里面提供,
decorators.xml 文件的位置就比較隨便了,在sitemesh.xml?中配置一下她的路徑就好
如:
? <property name="decorators-file" value="/WEB-INF/decorators.xml"/>
(2:)
decorators.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<decorators defaultdir="/jsp/decorators">
??? <decorator name="main" page="main.jsp">
??????? <pattern>*.jsp</pattern>
??? </decorator>
</decorators>
這里面可以定義多個decorator
對應不同的文件名,或者匹配不同的路徑何文件后綴都可以
(3:)
main.jsp
<%@ include file="/common/header.jsp">
<%@ taglib uri="sitemesh-decorator" prefix="decorator" %>
<%@ include file="/common/meta.jsp">
<html>
? <head>
??? <title><decorator:title default="decorator" />default title</title>
??? <decorator:head />
? </head>
? <body>
<%@ include file="/common/header.jsp">
??? <hr>
??? <decorator:body />
<%@ include file="/common/footer.jsp">
??? <hr>this is template footer
? </body>
</html>
不過SITMESH對一些設計來說簡直是在災難,ajax感覺無法與其整合在一起用