Stripes學習(一)

來源:互聯網
上載者:User

最近公司有一個項目要用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本地倉庫。

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工程

mvn archetype:generate -DarchetypeArtifactId=stripes-archetype-quickstart -DarchetypeGroupId=net.sourceforge -DarchetypeVersion=1.0 -DgroupId=tutorial -DartifactId=HelloWorld

注意:第三步的時候,如果報錯:

Embedded error: org.apache.maven.archetype.downloader.DownloadNotFoundException:Requested org.apache.maven.archetypes:stripes-archetype-quickstart:jar:1.0download does not exist.Unable to download the artifact from any repository

報錯原因是.m2下缺少maven相關外掛程式archetype。

請到這裡Download下載,然後將下載後的資源解壓,替換掉$HOME/.m2/repository/org/apache/maven這個目錄,然後再次執行,應該ok。

4、maven命令成功執行後,在$HOME(個人目錄)下會看到一個HelloWorld的工程,然後執行如下:

cd HelloWorldmvn jetty:run

5、jetty成功啟動後,去瀏覽器訪問http://localhost:8080/HelloWorld

就會看到:

Congratulations, you've set up a Stripes project!You are running Java version 1.6.0_24 on the Linux operating system.

這樣,我們用maven的stripes外掛程式構建的第一工程就ok了。

6、將該工程編譯成Eclipse工程

mvn clean install

mvn eclipse:clean eclipse:eclipse -Dwtpversion=1.5 -DdownloadSources=true

成功執行後,就可以將該工程import到Eclipse中了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.