Stripes学习(一)

8 篇文章 0 订阅

原文:http://blog.csdn.net/iisgirl/article/details/7479453

最近公司有一个项目要用stripes + spring(Spring JDBC)开发,用maven构建,linux(Ubuntu)系统,web服務器用websphere 6.0。

今天开始,深入浅出学习stripes,看看它优越于struts1的缘由究竟在哪里。

备注:开发之前,请保证机器上已经安装并且正確配置了java开发环境(jdk 5以上),maven等。

1、下载stripes的maven插件,stripes-archetype-quickstart-1.0.jar  Download

2、将stripes-archetype-quickstart-1.0.jar安装到maven本地仓库。

[plain]  view plain copy
  1. mvn install:install-file -Dfile=stripes-archetype-quickstart-1.0.jar -DgroupId=net.sourceforge -DartifactId=stripes-archetype-quickstart -Dversion=1.0 -Dpackaging=jar  

3、使用stripes插件创建第一个stripes工程

[plain]  view plain copy
  1. mvn archetype:generate -DarchetypeArtifactId=stripes-archetype-quickstart -DarchetypeGroupId=net.sourceforge -DarchetypeVersion=1.0 -DgroupId=tutorial -DartifactId=HelloWorld  

注意:第三步的时候,如果报错:

[plain]  view plain copy
  1. Embedded error: org.apache.maven.archetype.downloader.DownloadNotFoundException:  
  2. Requested org.apache.maven.archetypes:stripes-archetype-quickstart:jar:1.0  
  3. download does not exist.  
  4. Unable to download the artifact from any repository  

报错原因是.m2下缺少maven相关插件archetype。

请到这里Download下载,然后将下载后的资源解压,替换掉$HOME/.m2/repository/org/apache/maven这个目录,然后再次执行,应该ok。

4、maven命令成功执行后,在$HOME(个人目录)下会看到一个HelloWorld的工程,然后执行如下:

[plain]  view plain copy
  1. cd HelloWorld  
  2.   
  3.   
  4. mvn jetty:run  

5、jetty成功启动后,去浏览器访问http://localhost:8080/HelloWorld

就会看到:

[plain]  view plain copy
  1. Congratulations, you've set up a Stripes project!  
  2.   
  3. You are running Java version 1.6.0_24 on the Linux operating system.  

这样,我们用maven的stripes插件构建的第一工程就ok了。

6、将该工程编译成Eclipse工程

[plain]  view plain copy
  1. mvn clean install  

[plain]  view plain copy
  1. mvn eclipse:clean eclipse:eclipse -Dwtpversion=1.5 -DdownloadSources=true  

成功执行后,就可以将该工程import到Eclipse中了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值