- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi,
I'm trying to use struts 2 token-session interceptor to handle the double submissions in my application.
Here is my action class signature:
public class BusinessAction extends BaseAction implements Preparable
while the BaseAction extends ActionSupport implements SessionAware.
Here is my action configuration:
<action name="save" class="BusinessAction" method="save">
<interceptor-ref name="user-login"/>
<interceptor-ref name="token-session"/>
<interceptor-ref name="basicStack"/>
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="params" />
<interceptor-ref name="validation"/>
<interceptor-ref name="workflow"/>
<result name="login">/logout.jsp</
<result name="invalid.token">view.
<result name="input">/pages/editBu
<result type="redirect">view.do</r
</action>
Please note that when the token interceptor captures the invalid token i want the 'view' action to be invoked which is the same action that is invoked after a proper submission. After a normal submission the application will go to the view page. When the user does a double submission I want the application to show the view page of the first submission and ignore the further submissions.
In my input jsp page I've included the <s:token/> under the <s:form> tag.
This set up has successfully avoided the issue of submitting agian after pressing the browser back button.
But, when I submit once and then again before the process gets completed, the application breaks throwing the following error:
com.opensymphony.xwork2.in
com.opensymphony.xwork2.in
And then it throws a null pointer exception:
WebApp E [Servlet Error]-[<null>]: java.lang.NullPointerExcep
com.ibm.ws.webcontainer.sr
at com.ibm.ws.webcontainer.sr
I know I'm missing something, but couldn't figure out what it is. Could you please help me this issue.
Thanks,
Madhan
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: sanjoozPosted on 2008-05-09 at 18:01:57ID: 21537432
Not exactly sure what you are trying to accomplish. Are you trying to prevent double clicking on submit button?
The easiest way to avoid this, is to write javascript function to disable the submit button on the first click. Or if you can just make the submit button invisible after first click.