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

  • Home
  • SEARCH
  • 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 8299721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:16:01+00:00 2026-06-08T16:16:01+00:00

I have struts2 action method. It will be called from different server. i.e. In

  • 0

I have struts2 action method. It will be called from different server. i.e. In our applciation we are integrating the icici Payment gateway. My action method will be called from icici server. In that method i am performing some logic. Based on logic it will be redirected to some other action.

<action name="iciciResponse" class="com.yatrasoft.yatratravel.agent.b2c.PaymentGateWayAction" method="iciciResponse">
<result name="buybusTicket" type="redirect">/tentativeBusbooking.action?searchKey=${getSearchKey()}</result>
</action>

My booking logic is present in tentativeBusbooking() .After executing this method the result will be displayed to the end-user. Now browser URL will be like this.

http://192.168.0.94:8080/travelyatra/tentativeBusbooking.action?searchKey=NDIwMTMzMDR8MTQ5OTA4MjF8bnVsbHxudWxsfG51bGx8bnVsbHxudWxsfG51bGx8bnVsbHxudWxsfHxud

But the problem is, if the user refresh the browser, the tentativeBusbooking() is getting executed once again.

If i have JSP page, by using the s:token we can avoid the double form submission. But my action is called directly from the other server. So, How to avoid the double submission in this scenario.

If i need to write my own logic for this,can u help me. I am trainee s/w engineer(5 months experience only)…

  • 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-06-08T16:16:04+00:00Added an answer on June 8, 2026 at 4:16 pm

    My suggestion would be to do a redirectAction after tentativeBusbooking(). In this scenario, instead of returning SUCCESS, you would return a result such as “bookingComplete” with a result type of redirectAction.

    The result would be a display only jsp and if the page is refreshed, only the results would be displayed, not the original submission.

    For example:

    @Results({
    @Result(name = "success", location = "/WEB-INF/content/tentativeBusbooking.jsp"),
    @Result(name = "bookingComplete", type="redirectAction" location = "booking")})
    public class BoxController extends ActionSupport{
    
        public void execute(){
            return SUCCESS;
        }
    
        public void tentativeBusbooking(){
            //Do stuff...
            return "bookingComplete";
        }
    

    In the annotated example above, the bookingComplete result would result type would redirect the action back onto itself after the tentativeBusbooking() calling the execute() rather than the tentativeBusbooking() again when refreshed.

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

Sidebar

Related Questions

I have a Struts2 action in the server side for file downloading. <action name=download
I am working on struts2. In my action class I have written some accessors
In my struts.xml I have: <action name=file_save method=fileSave class=FileActionBean> <interceptor-ref name=fileUpload> <param name=maximumSize> 5242880
I'm having trouble calling a method in one Struts action from a method in
I am working on struts2 application. I have getter/setter in my action class. Now,
I have created JSNI methods i am registering 'createCallbackFunction' method from another method using
I have a struts and hibernate project, From the action class, I need to
I'm new to Struts2, coming from a PHP background, where I'd often have the
I have this code for login validation using a Struts2 action class which calls
in struts 2 execute method is not called by default. I have HelloWorld.java as

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.