Stripes学习(一)

秒速五厘米 2021-12-07 15:15 263阅读 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. mvn jetty:run

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

就会看到:

[plain] view plain copy

  1. Congratulations, you’ve set up a Stripes project!
  2. 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中了。

发表评论

表情:
评论列表 (有 0 条评论,263人围观)

还没有评论,来说两句吧...

相关阅读