欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
將aspectj集成到基于eclipse + lomboz + xmlbuddy的web應用中去
一、       配置eclipes開(kāi)發(fā)環(huán)境
首先,下載需要的插件:
eclipse-SDK-3.0.2-win32
Eclipse IDE
官方下載地址:
http://download.eclipse.org/downloads/drops/R-3.0.2-200503110845/eclipse-SDK-3.0.2-win32.zi
xmlbuddy_2.0.62
用于xml開(kāi)發(fā),可以用來(lái)編輯web.xml文件
官方下載地址:http://www.xmlbuddy.com/
org.objectweb.lomboz_3.0.1.N20050106
用于web開(kāi)發(fā),支持jsp,servlet等等的高亮顯示和編輯
官方下載地址:http://forge.objectweb.org/projects/lomboz/
ajdt_1.2_for_eclipse_3.0
用于A(yíng)spectJ開(kāi)發(fā),專(zhuān)為eclipse開(kāi)發(fā)的AspectJ插件
官方下載地址:http://www.xmlbuddy.com/
VE-runtime-1.0.2.2
安裝以上兩個(gè)插件時(shí)必備,一個(gè)相關(guān)的類(lèi)包含在此插件中。The Eclipse Visual Editor project is a vendor-neutral, open development platform supplying frameworks for creating GUI builders, and exemplary, extensible tool implementations for Swing/JFC and SWT/RCP. These tools are exemplary in that they verify the utility of the Eclipse Visual Editor frameworks, illustrate the appropriate use of those frameworks, and support the development and maintenance of the Eclipse Visual Editor Platform itself.
官方下載地址:http://www.xmlbuddy.com/
GEF-runtime-3.0.1
安裝VE時(shí)必備,The Graphical Editing Framework (GEF) allows developers to take an existing application model and quickly create a rich graphical editor.
官方下載地址:
http://download.eclipse.org/tools/gef/downloads/drops/R-3.0.1-200408311615/GEF-runtime-3.0.1.zip
emf-sdo-runtime-2.0.2
安裝VE時(shí)必備,EMF is a modeling framework and code generation facility for building tools and other applications based on a structured data model. From a model specification described in XMI, EMF provides tools and runtime support to produce a set of Java classes for the model, a set of adapter classes that enable viewing and command-based editing of the model, and a basic editor. Models can be specified using annotated Java, XML documents, or modeling tools like Rational Rose, then imported into EMF. Most important of all, EMF provides the foundation for interoperability with other EMF-based tools and applications.
官方下載地址:
http://download.eclipse.org/tools/emf/downloads/drops/2.0.2/R200503151315/emf-sdo-runtime-2.0.2.zip
[說(shuō)明] 現在最高版本的ajdt支持到eclipse3.0.2,所以相應的其他插件都選擇與eclipse相對應的最高版本。
2、下載完成后解壓進(jìn)行安裝:help -> softwareupdate -> find and install -> …from local….
3、進(jìn)行配置window -> perspective
配置aspectj:
不需要特別配置
配置lomboz:
A、設置jdk tools.jar位置,為安裝的j2sdk目錄
B、配置server definition:選擇Apache Tomcat : tomcat5.0.x,設置其Server lib和project lib,可以把%tomcat_home%/common/lib一些相關(guān)的包都放進(jìn)去,有可能是必須放,注意,某些版本據說(shuō)可能是5.0.27,需要修改目錄E:\eclipse3.0.2\plugins\com.objectlearn.jdt.j2ee_3.0.1
\servers,tomcat5.0.x配置文件tomcat50x.server文件,將兩處-Djava.endorsed.dirs=,
修改為如下:
-Djava.endorsed.dirs="${serverRootDirectory}/common/endorsed"
4、配置window -> customize perspective,將aspectj和lomboz相關(guān)的項目都給添加到new中,這樣就可以通過(guò)“新建“來(lái)建立相應的工程文件。
二、       集成AspectJ到Web工程中
5、新建一個(gè)AspectJ工程
6、在此工程中新建一個(gè)Lomboz J2EE Module
7、新建一個(gè)Servlet,并設置其url-mapping
/*
* Created on 2005-8-3 ,test
*
* @Author:Jonathan Q. Bo from tju.msnrl
* MyBlog:http://blog.csdn.net/jonathan_q_bo
*
*/
package org.tju.msnrl.jonathan.aspectj;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author Administrator
* 2005-8-3 14:46:22
*/
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
//TODO Method stub generated by Lomboz
ServletOutputStream out = response.getOutputStream( );
out.println("<h1>Hello World from an aspect-oriented Servlet!</h1>");
}
}
8、新建一個(gè)Aspect,攔截其doGet(..),在其執行之前和之后作相應的advice
/*
* Created on 2005-8-3 ,test
*
* @Author:Jonathan Q. Bo from tju.msnrl
* MyBlog:http://blog.csdn.net/jonathan_q_bo
*
*/
package org.tju.msnrl.jonathan.aspectj;
import java.io.IOException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author Administrator
* 2005-8-3 15:43:54
*/
public aspect HelloWorldAspect {
public pointcut captureHttpRequest(HttpServletRequest request,
HttpServletResponse response) :
execution(public void HelloWorld.doGet(HttpServletRequest,
HttpServletResponse)) &&
args(request, response);
before(HttpServletRequest request, HttpServletResponse response)
throws IOException :
captureHttpRequest(request, response)
{
response.setContentType("text/html");
ServletOutputStream out = response.getOutputStream( );
out.println("<html>");
out.println("<head><title>Adding a title using AspectJ!</title></head>");
out.println("<body>");
}
after(HttpServletRequest request, HttpServletResponse response)
throws IOException :
captureHttpRequest(request, response)
{
ServletOutputStream out = response.getOutputStream( );
out.println("</body>");
out.println("</html>");
}
}
9、部署工程,默認會(huì )將工程打包成war文件部署,試驗發(fā)現,war文件執行時(shí)會(huì )報錯,所以,需要改寫(xiě)build.xml文件,原build.xml文件將編譯好的文件統一放到dist文件夾中,然后對其打包war,簡(jiǎn)單修改,只需要將打包過(guò)程去掉,將dist文件夾直接拷貝到tomcat_home/webapps/下就可以了
<project name="webmodulebuilder"  default="deploy"  basedir=".">
<!-- set global properties for this build -->
<property file="build.properties"/>
<property name="dist" value="../../dist" />
<property name="deploy.dir" value="C:/Program Files/Apache Software Foundation/Tomcat 5.0/webapps/rbac" />
<property name="web" value="../" />
<target name="init">
<!-- Create the dist directory structure used by compile
and copy the deployment descriptors into it-->
<mkdir dir="${dist}"/>
<mkdir dir="${dist}/WEB-INF"/>
<mkdir dir="${dist}/WEB-INF/classes"/>
<mkdir dir="${dist}/WEB-INF/lib"/>
<copy todir="${dist}">
<fileset dir="${web}">
<include name="**/*.*"/>
<exclude name="**/*.java"/>
<exclude name="**/jsp_servlet/*.class"/>
<exclude name="**/build.xml"/>
<exclude name="**/deploy.xml"/>
<exclude name="**/build.properties"/>
<exclude name="**/servers.xml"/>
<exclude name="**/targets.xml"/>
<exclude name="**/*.war"/>
</fileset>
</copy>
<copy todir="${dist}/WEB-INF/classes">
<fileset dir="${project.dir}/${bin.dir}">
<include name="**/*.*"/>
<exclude name="**/jsp_servlet/*.class"/>
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="deploy" depends="undeploy,init" >
<mkdir dir="${deploy.dir}/rbac"/>
<copy todir="${deploy.dir}/rbac">
<fileset dir="${dist}">
<include name="**/*.*"/>
</fileset>
</copy>
<!-- Create the distribution directory -->
<!--<delete file="${war}.war" failonerror="false" />
<jar jarfile="${war}.war" basedir="${dist}" manifest="${dist}/META-INF/MANIFEST.MF"/>
<copy file="${war}.war" todir="${deploy.dir}"/>-->
<!--<delete file="${war}.war" failonerror="false" />-->
<!--<delete dir="${dist}" failonerror="false" />-->
</target>
<target name="deployTool">
<ant antfile="./deploy.xml" dir="." target="deploy" inheritall="true">
</ant>
</target>
<target name="undeploy">
<!-- Sometimes you can undeploy with deleting the module file but it is best dealt on an appserver basis
at undeployTool target -->
</target>
<target name="undeployTool">
<ant antfile="./undeploy.xml" dir="." target="undeploy" inheritall="true">
</ant>
</target>
</project>
10、打開(kāi)J2EE Lamboz View,選中Lomboz J2ee Module  -> 部署 deploy -> 運行服務(wù)器 Run server
11、在瀏覽器中輸入地址訪(fǎng)問(wèn),會(huì )出現如下結果,
Hello World from an aspect-oriented Servlet!
成功!
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
eclipse + java 環(huán)境搭建
J2EE開(kāi)發(fā)環(huán)境搭建(寶貝啊)
圖解利用Eclipse3 Lomboz3 Tomcat開(kāi)發(fā)JSP -- 4.一個(gè)Servlet實(shí)例 - 天宇流星的專(zhuān)欄
Eclipse XML 編輯器
Eclipse MyEclipse Lomboz圖解安裝JSP (收集) - 小螞蟻窩 -...
java開(kāi)發(fā)工具下載
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久