|
1. 對于eclipse而言,所有的環(huán)境地建立只是針對于一個(gè)workshop而言,尤其是對于服務(wù)器的有關(guān)配置。 (具體見cyberArtcle(網(wǎng)頁快捕)軟件中的eclipse的配置于使用) 2. 對于eclipse中在做web項(xiàng)目時(shí)需要外引一些包供程序使用時(shí),要把相關(guān)的包放到web-inf/lib下即可。(點(diǎn)擊從文件系統(tǒng)中導(dǎo)入即可,同時(shí)可以選擇相關(guān)的包即可,不必用所有的包)。 3.用myeclipse創(chuàng)建的J2EE項(xiàng)目,要注意:它不產(chǎn)生ejb-jar.xml文件。在按1.3的版本規(guī)范中可以通過工具xdoclet來 生成它們。在1.4的規(guī)范中,就需要自己創(chuàng)建他們。 4 對于有myeclipse插件之后,可以顯示圖像等文件。這些外部文件加入到工程項(xiàng)目中的辦法是:通過導(dǎo)入文件,zip等文件的形式導(dǎo)到指定的目錄下。這樣對于一些表象的頁面,可以在相應(yīng)的編輯器中編輯好,然后導(dǎo)入項(xiàng)目工程中! 5.對于文件可以采用拖放的辦法,來改變父目錄。 6.對于eclipse而言,對于js文件的改變不重新構(gòu)建項(xiàng)目,因此需要改變相關(guān)的jsp/servlet等文件,以期在保存是重新構(gòu)建項(xiàng)目,從而得到保存! 7。對于web application而言,它每一個(gè)部分都可單獨(dú)構(gòu)建到web容器中,作為單獨(dú)的模塊運(yùn)行! 8.對于向EJB中導(dǎo)入jar文件時(shí),會(huì)以表示類信息的文本的文件導(dǎo)入,這時(shí)不能引用相關(guān)包的文件??捎医?〉屬性-〉源代碼,然后引入對應(yīng)的包即可?。ㄟ@樣區(qū)別于上面的是在于他為該包引入了源文件,而上面的引用只在部署的時(shí)候才引用到服務(wù)器中去)。
在eclipse中生成的web.xml文檔中不能使用生成的web-app頭,他不支持服務(wù)器的本分配置處理 應(yīng)該使用<web-app version="2.4" xmlns="http://java./xml/ns/j2ee" xmlns:xsi="http://www./2001/XMLSchema-instance" xsi:schemaLocation="http://java./xml/ns/j2ee http://java./xml/ns/j2ee/web-app_2_4.xsd"> 在eclipse中.project文件是描述各個(gè)模塊或者是application web中描述各個(gè)模塊的。例application web中描述各個(gè)模塊的: <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>DLManagementConsole</name> //web application的名 <comment></comment> <projects> //有關(guān)application web的模塊配置 <project>DLManagementConsoleWeb</project> <project>DLManagementMagazineEJB</project> </projects> <buildSpec> //編譯的一些平臺(tái)文件 <buildCommand> <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.ibm.etools.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.ibm.sse.model.structuredbuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature> <nature>com.genuitec.eclipse.j2eedt.core.earnature</nature> </natures> </projectDescription> 模塊描述: <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>MagazineResearchStageWeb</name> <comment></comment> <projects> <project>MagazineResearchStageEJB</project> //它引所用到的模塊 </projects> <buildSpec> <buildCommand> <name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.ibm.etools.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.ibm.sse.model.structuredbuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature> <nature>com.genuitec.eclipse.j2eedt.core.webnature</nature> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription>
.classpath文件是用來描述程序模塊編譯的classpath: <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> //引用到文件類的包名或ejb的模塊名 <classpathentry kind="src" path="/MagazineResearchStageEJB"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 平臺(tái)所包含的包 <classpathentry kind="con" path="com.genuitec.eclipse.j2eedt.core.J2EE13_CONTAINER"/> <classpathentry kind="output" path="WebRoot/WEB-INF/classes"/> //輸出到部署指定的文件中 </classpath> 當(dāng)然在myeclipse平臺(tái)上還有一些文件時(shí)myeclipse對項(xiàng)目的一些描述(.mymetadata文件): <?xml version="1.0" encoding="UTF-8"?> <project-module type="WEB" name="MagazineResearchStageWeb" id="myeclipse.1115630257656" context-root="/MagazineResearchStageWeb" j2ee-spec="1.3" archive="MagazineResearchStageWeb.war"> <attributes> <attribute name="webrootdir" value="WebRoot" /> </attributes> </project-module>
以上的這些部署文件在使用的時(shí)候,可能會(huì)影響到模塊之間的調(diào)用。特別是一些非正常的損壞,要及時(shí)地查看這些文件,看是不是有這些文件所引起的。
|