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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:32:20+00:00 2026-05-23T03:32:20+00:00

In my webpage (Eg Link1: http://localhost:8086/MyStrutsApp/login.do ) I have several links. When a user

  • 0

In my webpage (Eg Link1: http://localhost:8086/MyStrutsApp/login.do) I have several links. When a user clicks on one of the links, he is taken to another page (Eg link2: http://localhost:8086/MyStrutsApp/AddBook.jsp) to fill an html form.

Now what I want to achieve is that when any user clicks on the link, that html form (Link2) is displayed on the same page (i.e. Link1).

I have no idea how to achieve this.

  • 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-23T03:32:21+00:00Added an answer on May 23, 2026 at 3:32 am

    The AJAX way to achieve this is the following:

    • you have a DIV on your original page that will be replaced (i.e., either has content that only makes sense in the original context or completely empty)
    • your Link2 servlet produces only the contents of the above DIV (and not the contents of that page)
    • you use a tiny bit of Javascript to make an AJAX call and fill the DIV with the response.

    If you want to use Dojo, the HTML page would look like this:

    <!-- main content -->
    <div id="leftpanel">
        <h3>This content will be replaced</h3>
        You can <a href="#" onClick="updateFromURL('/MyStrutsApp/AddBook.jsp)">add a book</a>
    </div>
    

    The Javascript code would look like this:

    <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dojo/dojo.xd.js" type="text/javascript"></script>
    <script type="text/javascript">
    function display_wait(s) {
      var mainPanel=dojo.byId("leftpanel");
      mainPanel.innerHTML='<div class="waitingmsg">'+s+'</div>';
    }
    
    function updateFromURL(url) {
        display_wait("loading content");
        dojo.xhrGet({url:url,
                    load:function(result) {
                    dojo.byId('leftpanel').innerHTML=result;
                }});
    }
    </script>
    

    (As Rafa mentioned, you can use the same technique to display the new part in a dialog)

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

Sidebar

Related Questions

Please see the the following http://valogiannis.com/recent/ .I have a webpage and when user click
I am linking some stories on FaceBook, but the url I have is: http://webpage.com/single.php?2011/02/04/my-story-here.html
I have an ASP.NET 2.0 (C#) webpage with a link that pulls a blob
I have the following line of code in a link on my webpage: <a
I have a webpage where Firefox 2 displays the font certain, really specific elements,
If you have a link to a webpage in a MicroSoft Word document and
Suppose I have the following within a webpage <% using (Html.BeginForm(ShowData, Summary)) %> <%
I have a compiled class library containing a user control and I'd like to
I have an anchor on my webpage: <a name=here></a> and I link to it
I have a webpage from the Fogbugz bug tracking system, and using a plugin

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.