Forums: Open Discussion (Thread #22448)

2.6データベースアクセス (2009-04-21 10:20 by Anonymous #43307)

データベースアクセスのプロセスでlist.jspを変更すると、
<input type="button" value="削除" onclick="setDeleteSubmit('<%=id%>');"/>
の部分のidが解決されませんというエラーが発生します。
原因の分かる方はご指摘をお願いします。

Reply to #43307×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 11:07 by taromaru #43308)

<bean:define id="id" name="userBean" property="id"/>
の追加を忘れているか、
id属性の値「id」の綴りを間違っているか
のどちらかではないでしょうか。
Reply to #43307

Reply to #43308×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 11:29 by Anonymous #43309)

ご指摘ありがとうございます。

<td>
<bean:define id="id" name="userBean" property="id"/>
<input type="button" value="削除" onclick="setDeleteSubmit('<%=id%>');"/>
</td>

と追加してエラーが発生しているため、
<bean:define id="id" name="userBean" property="id"/>
の追加以外の原因であると考えられます。
Reply to #43308

Reply to #43309×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 12:02 by taromaru #43310)

<input type="button" value="削除" onclick="setDeleteSubmit('<%=id%>');"/>
の「id」に対して、
idが解決されません
というエラーは、どこででていますでしょうか。

例えば、
・統合開発環境(Eclipse等)
・実行時にブラウザに表示される
等。

実行に支障がなく、
統合開発環境等でのみエラーがでている場合は、
ご使用の統合開発環境等が
その記述に対応していないことが考えられます。

なお、当方では、Eclipse3.2.2で、
idが解決されない旨のエラーが出ないことを確認しています。
バージョンが古いEclipse(2.x.x)を使用していると、
同様のエラーが発生した覚えがあります。
Reply to #43309

Reply to #43310×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 12:16 by Anonymous #43311)

エラーはEclipse環境でlist.jsp保存時に発生します。
Eclipseのバージョンは3.2です。
このエラーがある状態でもWEB画面のログオン操作は可能ですが、
一覧表示選択時にエラー画面に移動します。
Reply to #43310

Reply to #43311×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 13:08 by taromaru #43319)

一覧表示選択時にエラー画面に移動した際のログを載せていただけますでしょうか。

例えば、以下のようなものです。
(Eclipse上から起動している場合は、コンソールに出力されます。)

JSPファイル: /welcome.jsp の中の18行目でエラーが発生しました
id cannot be resolved
15: <body>
16: <center>
17: <bean:define id="id" name="userBean" property="id"/>
18: <input type="button" value="削除" onclick="setDeleteSubmit('<%=id%>');"/>
19:
20: -- ようこそTERASOLUNAへ --
21:

Reply to #43311

Reply to #43319×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 13:49 by Anonymous #43320)

list.jsp保存時に問題ビューに以下のエラーが表示されます。
重大度および説明 パス リソース ロケーション 作成時刻 ID
id を解決できません。 terasoluna-spring-thin-blank/webapps list.jsp 行 81 1240280397937 16574

実行時には
2009/04/21 13:41:59][WARN][ValidatorResources] Form '/listSCR' not found for locale 'ja'
[2009/04/21 13:42:03][ERROR][ApplicationDispatcher] サーブレット jsp のServlet.service()が例外を投げました
javax.servlet.jsp.JspException: アクション /delete に対応するマッピングが見つかりません
というメッセージが表示されています。
Reply to #43319

Reply to #43320×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 14:16 by Anonymous #43321)

実行時のエラーメッセージを追記します。


[[2009/04/21 13:41:59][WARN][ValidatorResources] Form '/listSCR' not found for locale 'ja'
[2009/04/21 13:42:03][ERROR][ApplicationDispatcher] サーブレット jsp のServlet.service()が例外を投げました
javax.servlet.jsp.JspException: アクション /delete に対応するマッピングが見つかりません
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:759)
     ・・・・・・(省略)
[2009/04/21 13:42:03][ERROR][RequestProcessorEx] sessionHash = 9E04A56749903F12C841AC0C0AD27D3496F54BE3
[2009/04/21 13:42:03][ERROR][RequestProcessorEx] org.apache.jasper.JasperException: Exception in JSP: /list.jsp:48

45: action="/list" name="dynaFormBean" rowProperty="row"
46: totalProperty="totalCount" indexProperty="startIndex"
47: currentPageIndex="now" totalPageCount="total"/>
48: <ts:form action="/delete">
49: <center>
50: <h5>
51:
Reply to #43320

Reply to #43321×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 14:19 by taromaru #43322)

「アクション /delete に対応するマッピングが見つかりません」
は、struts-config.xmlのアクションマッピングに
<action path="/delete"~>
が無いということを意味しています。

同時に、このエラーが出るということは、
JSPのコンパイルは通っているので、
変数idは解決されていることになります。

Eclipse上で出ているエラーに関してですが、
問題ビューに出ている作成時刻
(1240280397937=>2009/04/21 11:19:57)
が少し前のものから更新されていないようですので、
バリデータが以前に検出したエラーが残っている可能性があります。
(自動ビルドにしていない場合、修正保存後もエラーが残ります)
list.jspを開いているJSPエディタで、
右クリック->「検証」
を実行してみてください。
Reply to #43321

Reply to #43322×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 2.6データベースアクセス (2009-04-21 14:46 by Anonymous #43323)

御指摘の通りstruts-config.xmlに<action path="/delete"~>の記述がありませんでした。
上記を記述した結果うまく実行できました。
ありがとうございます。
Reply to #43322

Reply to #43323×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login