You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Wyatt <jw...@itree.com.au> on 2007/04/18 07:05:22 UTC
Struts 2 interceptors vs
Hi,
I've written a simple PagingInterceptor in a Struts 2 project to do a
trivial calculation of the pageNumber used to display paged results, based
on whether the user pressed either a "Search", "Next Page" or "Previous
Page" submit button.
I'm using the following interceptor stack:
<interceptor-stack name="usersearch" >
<interceptor-ref name="searchPaging" />
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
<interceptor name="searchPaging"
class="itree.iacd.interceptor.PagingInterceptor"/>
The PagingInterceptor reads the "submit" parameter from the request,
increments or decrements the pageNumber, and stores pageNumber back in the
request.
This works fine, however I also want to use the "method" param for the
<s:submit> button like such:
<s:submit name="submit" value="Save" method="save" />
I noticed when I add method="save" and hit the page with a browser, the
"submit" parameter seems to have been removed from the request *before* it
hits the top of the interceptor stack for the page, thus breaking my
PagingInterceptor.
Any ideas on why the submit parameter is removed, and how to fix this
problem - preferably via the Struts 2 framework?
Thanks in advance for any help, regards
Jason
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Itree Software www.itree.com.au
Ph (02)42263454 Fax (02)42263193
-> Meeting your requirements.
-> Delivering on promises.
-> Pride in our work.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org