Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7434343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:49:16+00:00 2026-05-29T09:49:16+00:00

I have a Struts 1 application that uses a little bit a Ajax to

  • 0

I have a Struts 1 application that uses a little bit a Ajax to create and delete some objects in the application. For both the create and the delete operations, when the operation is posted by the browser it gets processed twice by the server.

This is not a case of the ajax being posted twice by the browser. I used a the Paros proxy tool to confirm that the ajax request is sent only once by the browser, but my action class still gets called twice.

Using Eclipse I set a debug breakpoint, and have noticed that the call stack is not the same for each time through my action class.

First pass I get

MyActionClass.getDisplayPage(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) line: 65   
MyActionClass(Action).execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) line: 224 
ExecuteAction.execute(ActionContext, Action, ActionConfig, ActionForm) line: 53 
ExecuteAction(AbstractExecuteAction).execute(ActionContext) line: 64    
ExecuteAction(ActionCommandBase).execute(Context) line: 48  
ChainBase.execute(Context) line: 190    
LookupCommand.execute(Context) line: 304    
ChainBase.execute(Context) line: 190    
ComposableRequestProcessor.process(HttpServletRequest, HttpServletResponse) line: 280   
ActionServlet.process(HttpServletRequest, HttpServletResponse) line: 1858   
ActionServlet.doPost(HttpServletRequest, HttpServletResponse) line: 459 

Second pass I get (extra lines marked with ***)

MyActionClass.getDisplayPage(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) line: 65   
***MyActionClass.unspecified(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) line: 199  
***MyActionClass(DispatchAction).dispatchMethod(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse, String) line: 242   
***MyActionClass(DispatchAction).execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) line: 167  
***MyActionClass(Action).execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) line: 217  
ExecuteAction.execute(ActionContext, Action, ActionConfig, ActionForm) line: 53 
ExecuteAction(AbstractExecuteAction).execute(ActionContext) line: 64    
ExecuteAction(ActionCommandBase).execute(Context) line: 48  
ChainBase.execute(Context) line: 190    
LookupCommand.execute(Context) line: 304    
ChainBase.execute(Context) line: 190    
ComposableRequestProcessor.process(HttpServletRequest, HttpServletResponse) line: 280   
ActionServlet.process(HttpServletRequest, HttpServletResponse) line: 1858   
ActionServlet.doPost(HttpServletRequest, HttpServletResponse) line: 459 

Other than the marked differences, the call stacks are identical.

Here is the struts config action pertaining to this post

<action path="/myAjaxRequest"
  type="com..example.MyActionClass"
  name="myActionForm"
  parameter="save">
</action>

Does anybody have any ideas what the where the second pass through is coming from? I don’t know where to begin to look.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:49:17+00:00Added an answer on May 29, 2026 at 9:49 am

    Turns out this behaviour is caused by a “feature” of the application. Whoever designed the application overrode the DispatchAction.execute() method. The overriding execute() method, when receiving a null ActionForward from an action class, will attempt to call the action again using a different call path.

    Since my action is servicing an ajax request, it was returning null on purpose after executing successfully. The result was that my action was being called again by the execute() method, and the request would be processed a second time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSP struts application that uses Spring to integrate with the services/dao/database.
I have a Struts application that at some point offers the possibility to download
There is a Java Struts application running on Tomcat, that have some memory errors.
I have a struts application that uses Hibernate to access a MYSQL DB. I
I have a Struts 1.3 and Hibernate 3.1 application that uses an open-session-in-view pattern
We have a Struts 2 web application that's used by pretty much every employee
I have a web application that developed using j2ee and Struts 2 MVC. Sometimes
in a struts application, I have a filter that forces certain pages to be
I have a struts application that has a form to edit user details. I
I have a Struts based web application that has a structure similar to the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.