Foren: Offene Diskussion (Thread #36645)

pageLinksのsubmit属性の動作について (2015-04-02 13:01 by anonymous #75869)

お世話になります。

pageLinksタグにてsubmit属性を指定した際に、submit先のForm名が取得できないといった問題が発生し頭を悩ませています。

どうもActionFormUtil#getActionFormName(HttpServletRequest)が"null"を返却しているようで、生成されたjavascriptもdocument.null.submit()といったコードとなっています。

ActionFormUtil#getActionFormName(HttpServletRequest)がnullを返却する場合に考えられる原因、対策等ご存じの方いらっしゃいませんでしょうか。

画面は検索系の画面で、明細部にページリンクを持つような構成になっています。
/ASearchViewで初期表示を行い、検索ボタン押下で/ASearchActionに定義したBLogicを実行して、結果を/ASearchViewに表示します。

----------------------------------------------------------
// struts-config.xml
<!-- 初期表示、結果表示-->
<action path="ASearchView" parameter="A.jsp" />
<!-- 検索実行-->
<action path="ASearchAction" name="_A" scope="session" validate="true" input="A.jsp">
<forward name="success" path="ASearchView" />
</action>


//A.jsp
<!--form-->
<ts:form method="POST" action="/ASearchAction.do" styleId="_A" >

<!--pageLinksの定義-->
<ts:pageLinks id="userListPageLinks_A" submit="true" name="_A" rowProperty="row" totalProperty="totalCount" indexProperty="startIndex" currentPageIndex="now" totalPageCount="total"/>

<!--PageLinksの設置-->
<bean:write name="userListPageLinks_A" filter="false"/>

----------------------------------------------------------

Reply to #75869×

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.) Anmelden

Re: pageLinksのsubmit属性の動作について (2015-04-02 14:29 by anonymous #75873)

[メッセージ #75869 への返信]

自己レスです。

ASearchViewで画面表示を担当する際のActionFormがstrut-config.xmlに定義されていないのが原因のようでした。
指定したところ、検索後1回目の際のみ、正常にPageLinksが作成されていました。

しかしながら、1度その状態でページング処理を行うと、http://hostname/A.jsp#に遷移してしまうようで、ページング処理後の画面ではActionFormがnullの状態となるようです。

1度ページング処理ができたことで、自分のやろうとしていたことがそもそもsubmit属性をつけても実現できないことがわかったため、自前のページング処理を実装することとしました。
本件は自己解決扱いでお願いいたします。
Reply to #75869

Reply to #75873×

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.) Anmelden