??? 在一個gwt(google web toolkit)中,一般有一個默認的包“client”,如果我新增了一個包“lib”應該怎么做呢?
??? 方法一(直接增加資源路徑):
??? ?? 比如你的項目名為“AX”,那么會有一個對應的文件“AX.gwt.xml”,在此文件中加入如下內容
??? ?? <module>
??? ?? ?? 。。。。。
?? ??? ??? <source path="lib"/>
??? ?? ?? 。。。。。
??? ??? </module>
??? 方法二(多重包含):
??? ?? 首先找到文件“AX.gwt.xml”在文件中加入對另外一個文件(比如“YY.gwt.xml”)的引用,如下
??? ?? 。。。。
??? ?? <inherits name='com.KF.YY'></inherits>
??? ?? 。。。。
??? ?? 然后在文件“YY.gwt.xml”中加入與方法一相似的代碼,如下
??? ?? <module>
?? ??? ??? <source path="lib"/>
??? ??? </module>
??? 方法三(新增包與包“client”不在同一目錄時)(
參考)
??? ?? 這里舉一個定義組件的例子
??? ?? 自定義組件包為“
com.gwt.components.client
”
??? ?? 在增加文件:在“
com.gwt.components
”下增加文件“user.gwt.xml”
??? ?? ?? 內容:
<module>
? <inherits name="com.google.gwt.core.Core"/>
</module>
??? ?? 在
AX.gwt.xml中加入如下
??? ?? 。。。。
??? ?? <inherits name='
com.gwt.components.user
'></inherits>
??? ?? 。。。。
??? ?? 此時默認的會包含文件“user.gwt.xml”所在目錄下的“client”,如果在此目錄下你還有其它的目錄,就需要用文件“user.gwt.xml”中加入“<source path='你的目錄'”。
在google的網站上有對“module”更專業的說明:http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.Modules.html