Home > 未分類 > NetBeans5.5でStruts開発(1)

NetBeans5.5でStruts開発(1)

IDE(総合開発環境)であるNetBeansは現在5.5がリリースされています。拡張性はもちろんオープンソースであるEclipseの方が圧倒的ですが、NetBeansはWEBアプリケーション開発におけるあれこれが、はじめから武装されています。

この画像を見る限り、頼もしいツールであることは間違いないですね。

なぜ僕がこのIDEを使おうかと思ったのかは、勉強がてら、あとリクルート×SUNのMashup Award 2ndに出場する際、NetBeansを使うと加点されるからです。記念出場みたいなものなので加点されても意味ないかもしれませんが、Eclipseのよいところもまた再発見できるかと思っています。

NetBeansのインストールは簡単です。 ここから最新版をダウンロードで終わりです。 http://www.netbeans.org/index_ja.html 今回はプロジェクトとスケルトンの作成まで解説します。
NetBeansを立ち上げるとスタートガイドなどが表示されますが、これは無視しましょう。

メインメニューにあるファイル→新規プロジェクトを選択します。

もちろんWebアプリケーションを選択します。

次へ

プロジェクト名を入力します。アプリケーションの名前にでもしておきましょう。

次へ

ここでやっとStrutsという単語がでてきました。Strutsを選択して完了です。
これでアプリのスケルトンが生成されました。

index.jspはこのようになっています。

<%@page contentType="text/html"%>
<%@page pageEncoding=”UTF-8″%>
<%– The taglib directive below imports the JSTL library. If you uncomment it, you must also add the JSTL library to the project. The Add Library… action on Libraries node in Projects view can be used to add the JSTL 1.1 library. –%>
<%– <%@taglib uri=”http://java.sun.com/jsp/jstl/core” prefix=”c”%>
–%>

<meta equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<title>JSP Page</title>

<h1>JSP Page</h1>

<a href=”http://www2.blogger.com/Welcome.do”>Struts Welcome Page</a>

<%– This example uses JSTL, uncomment the taglib directive above. To test, display the page like this: index.jsp?sayHello=true&name=Murphy –%>
<%– <c:if test=”${param.sayHello}”>
<!– Let’s welcome the user ${param.name} –>
Hello ${param.name}!
</c:if>
–%>

「主プロジェクトを実行」というボタンを押すと、ブラウザがたちあがり、アプリケーションがTomcatとservletで動いているのが確認できると思います。

簡単ですね。

Comments:0

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://diary.fukuyamakoto.com/archives/4/trackback
Listed below are links to weblogs that reference
NetBeans5.5でStruts開発(1) from REALGOLD::なんとなく、微炭酸

Home > 未分類 > NetBeans5.5でStruts開発(1)

Search
Feeds
Meta

Return to page top