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 9202273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:13:01+00:00 2026-06-17T23:13:01+00:00

I have a Struts2 form that is included in a DIV overlay on a

  • 0

I have a Struts2 form that is included in a DIV overlay on a page. When I submit this form I want it to hide/show a hidden text area on the bottom of the form that just lets the user know that the form was submitted. From there the user could close the overlay and return back to their work. I’m having a problem accomplishing this. Upon my Return of a SUCCESS or NONE the page will redirect to a blank page if I do not provide it with another page in the return. How can I submit the form and stay within the same page without redirecting at all?

Currently I am submitting the form using JavaScript

document.forms['formName'].submit(); 

I am using JavaScript as opposed to the <s:submit/> option because there are other parameters that need to be set on the form itself prior to form submission.

  • 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-17T23:13:03+00:00Added an answer on June 17, 2026 at 11:13 pm

    What you need is: AJAX.

    In Struts2 you can achieve it out-of-the-box with an <sx:div> of the( deprecated since Struts 2.1, but still here and working) Struts2-Dojo Plugin.

    Basically, you target the div with the dojo topic, and the result of your Action, a JSP file containing an HTML/JSP snippet, will fill the div without reloading the page.

    But if you are using the latest versions of Struts2, you can easily achieve this with Struts2-jQuery Plugin, and you can find all the working example with the code too in its Showcase.

    This is an example:

    <s:url id="ajax" value="/ajax1.action"/>
    <sj:div href="%{ajax}" indicator="indicator">
           <img id="indicator" src="images/indicator.gif" 
                alt="Loading..."    style="display:none"/>
    </sj:div>
    

    Pretty easy 🙂

    You can obviously alter the href attribute with javascript too, if you need to set parameters at runtime… just get id by id and alter href attribute.

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

Sidebar

Related Questions

I have the following form in a Struts2 JSP that contains some radio buttons.
I have a struts2 action that builds a form and pre-populates the fields with
I have a simple form that I don't want accidentally submitted multiple times. I
I'm doing a project with struts2, Hibernate. I want struts to validate my form.
I have a form with a field that may have zero to multiple values
I have a problem with a Struts2 + dojo web application that I've inherited.
I have a struts form that contains many input fields generated using indexed properties.
I have a form that I need to be validated when submitted. I have
We have an running application that is developed in struts-2.0.14 . In this we
Trying to work with multiple submit buttons within a single form in struts2 application

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.