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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:11:13+00:00 2026-06-09T11:11:13+00:00

I have a main html page which contains an IFRAME. I have a server

  • 0

I have a main html page which contains an IFRAME.
I have a server side jsp code that is displayed with some default values inside the IFRAME for the first time.
Whenever a person tries to use a search button in the main page the results are displayed in the IFRAME updating its content.
I have a servlet that does the calculation on the searched data and updates the IFRAME content.

The problem:
I have used the sendRedirect method in servlet to refresh the IFRAME but to no avail.
The string I am passing to sendRedirect is /results.jsp?search=value&size=1 (jsp to be displayed in iframe).
The servlet does its calculation work properly but opens a new page in place of the mainpage: not a desired output.
The mainpage with its interface should remain there, only the IFRAME should refresh.

My question:
Is this the correct method to refresh an iframe? If not kindly tell me what should I use to update my iframe (jsp) via servlet.

PS: Please forgive the absurdity of the quesion if any. I am new to the jsp-servlet.

Any help is much appreciated

  • 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-09T11:11:14+00:00Added an answer on June 9, 2026 at 11:11 am

    When you do a redirect using response.sendRedirect() method, the actual ‘frame’ where the servlet was called will be modified. That frame can be the entire page, or an iframe, or even the legacy frames used in javadocs.

    As @Jake223 said, set the target attribute to the iframe name in the form:

    If you are using a form to submit the information, then you do something like this:

    <iframe name="resultframe"></iframe>
    <form action=[path to servlet] target="resultframe">
        <input type="text" name="searchq"/>
        <input type="submit" value="search"/>
    </form>
    

    If you are using javascript to create the iframe, then use the src attribute of the iframe:

    <iframe src=[path to servlet]?[request params]></iframe>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In JavaScript, let's say we have a main page ( main.html ) which contains
I have a main page (main.html) which opens an iframe page (iframe.html).. The iframe
I have an PHP/HTML main page, in which I include different other PHP files
I have included JQuery on my main page which is a html page, in
i have main html page which have two frames frame1 and frame2. frame1 is
i have a html page called main.html which have a frame frame1 and a
i have a html page main.html and it has a frame frame1 in which
I have 2 files, main.html and search.php . Within the main.html page, there is
I am using jQuery for a simple website and have a main page 'index.html'
I want to have a web page that contains 3 parts: A header at

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.