Quick Startfor Web Application
2.2.4で作成したm_userテーブルのuser_id、user_name、mailカラムの値をリスト表示する画面を作成します。
- Eclipseでfalcon_web_tutorial/WEB-INF/falcon/app.xmlファイル(以下app.xmlファイル 80行目あたりから)を開き、リスト 2-6のように修正を行います。
<w:menu name="menu" template="titlemenu"> </w:menu> <w:panel name="mainPanel"> <w:unit name="userList" initial="userList"/> <!-- ←TOPページを指定します --> </w:panel> <w:form name="userForm"> <w:dataSource dao="userMap"/> <w:field header="ユーザID" name="user_id" type="text" maxlength="128" size="40"/> <w:field header="パスワード" name="password" type="password" maxlength="128" size="40"/> <w:field header="名前" name="user_name" type="text" maxlength="128" size="40"/> <w:field header="メールアドレス" name="mail" type="text" maxlength="128" size="40"/> <w:field header="郵便番号" name="zip" type="text" maxlength="7" size="10"/> <w:field header="住所" name="address" type="textarea" col="40" row="5"/> <w:field header="電話番号" name="tel" type="text" maxlength="11" size="10"/> <w:field header="誕生日" name="birthday" type="text" maxlength="8" size="10"/> <w:commandBox name="edit"> <w:insert type="button" text="追加"/> <w:update type="button" text="更新"/> <w:delete type="button" text="削除"/> <w:ok type="button" text="OK"/> <w:cancel type="button" text="キャンセル"/> </w:commandBox> </w:form> <w:list name="userList"> <w:dataSource dao="userMap"/><!-- ←データソースを指定します --> <!-- ↓リストに表示するフィールドの定義です --> <w:field header="ユーザID" name="user_id"/> <w:field header="名前" name="user_name"/> <w:field header="メールアドレス" name="mail"/> </w:list> </w:application>
リスト 2-6 app.xmlファイル(80行目あたりから)
- ブラウザで以下のURLにアクセスし、app.xmlファイルの修正内容を反映します。app.xmlファイルの修正内容反映後、図 2-10の画面が表示されます。
http://localhost:8080/tutorial/?control=init
図 2-10