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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:41:16+00:00 2026-05-25T14:41:16+00:00

I am displaying time using Jsp and it is the home page for my

  • 0

I am displaying time using Jsp and it is the home page for my application .. I am using the following code to refresh the time

<META HTTP-EQUIV="Refresh" CONTENT="1">

but it is refreshing entire page .. but my requirement is refreshing only date and not the entire page .. Help me out in solving this problem

Thanks in Advance
Raj

  • 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-25T14:41:16+00:00Added an answer on May 25, 2026 at 2:41 pm

    If you want partial page updates, then there is no other way than using JavaScript/Ajax (okay, you can in theory do so with a client side application like a Java applet, but that’s plain clumsy). JSP runs on the server side, generates a bunch of HTML and sends it to the client side. On the client side, there is no means of any Java/JSP code. All you can do is to grab JavaScript for a bit dynamics. JavaScript is able to send HTTP requests/responses asynchronously and access/manipulate the HTML DOM tree.

    • Learn the basic JavaScript concepts: JavaScript tutorial
    • Learn the Ajax concepts: Ajax tutorial
    • Learn the jQuery which makes Ajax/HTMLDOM very easy and crossbrowser compatible: jQuery
    • Learn Servlets: our Servlets wiki page

    Now you can work through the examples provided in How to use Servlets and Ajax? to grasp the general concepts so that you can reapply it for your own use case. Here’s a basic kickoff example:

    <div id="serverTime"></div>
    
    <script>
        setTimeout(function() {
            $.get("timeServlet", function(response) {
                $("#serverTime").text(response);
            });
        }, 1000);
    </script>
    

    with the following in servlet’s doGet()

    response.setHeader("Cache-Control", "no-cache,no-store,must-revalidate");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("Expires", 0);
    
    response.setContentType("text/plain");
    response.getWriter().write(new Date()); // Use SimpleDateFormat if necessary.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application,I am using more than html page for displaying the content and
How to create simple PHP COMET server page displaying current time? I need code
When i'm displaying image from url with using below code, application is taking too
I am writing a code for displaying time vs size. I am using a
My application needs to display the time. Rather then displaying time as 11:00 I
I'm English but working for an American client, he wants the time displaying plus
I am having difficulties trying displaying a thumbnail with time DURATION. The code renders
I have an application that has a UILabel displaying the current date and time,
I have some (OpenCV) code that generates images. I'm displaying these using OpenGL. When
I'm displaying HTML content using a UIWebView and would like some action to occur

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.