{"id":29,"date":"2008-12-08T13:51:00","date_gmt":"2008-12-08T11:51:00","guid":{"rendered":"https:\/\/blog.lifshitz.net\/adding-ajax-delayloading-indicator-using-java-stripes"},"modified":"2014-11-17T16:09:05","modified_gmt":"2014-11-17T14:09:05","slug":"adding-ajax-delayloading-indicator-using-java-stripes","status":"publish","type":"post","link":"https:\/\/blog.lifshitz.net\/?p=29","title":{"rendered":"Adding AJAX delay\/loading indicator using Java Stripes"},"content":{"rendered":"<p>While exploring the  <a href=\"http:\/\/www.stripesframework.org\/\">Stripes<\/a> framework, I spent a while looking at how to add the &#8216;spinner&#8217; indicator when your server side is processing a long request. Here&#8217;s a short summary of what I did to achieve that, hope it could help save someone a little time:<\/p>\n<p>1. Select a spinner image \ud83d\ude42 I found this cool place where you can generate an image of your choosing at <a href=\"http:\/\/www.ajaxload.info\/\">ajaxload.info<\/a>. Generate whatever you like and save it somewhere, let&#8217;s say under &#8216;images\/smallspinner.gif&#8217;.<\/p>\n<p>2. In your .jsp file add the following javascript method just before the invoke method you use (again, assuming you&#8217;re working with Stripes):<br \/><code><\/p>\n<pre><br \/>function showSpinner(container)  {<br \/>         var obj = document.getElementById(container);<br \/>         obj.innerHTML = \"&lt;div ID='spinner'&gt;<br \/>\t\t&lt;img src='images\/smallspinner.gif'\/&gt;&lt;\/div&gt;\";<br \/>}<br \/><\/pre>\n<p><\/code><br \/>then update your invoke method to call the <i>showSpinner<\/i> method at the right time:<br \/><code><\/p>\n<pre><br \/>function invoke(form, event, container) {<br \/>         if (!form.onsubmit) { <br \/>             form.onsubmit = function() { return false } <br \/>         };<br \/>        <strong> showSpinner(container); \/\/This is the new call..<\/strong><br \/>         var params = Form.serialize(form, {submit:event});<br \/>         new Ajax.Updater(container, form.action, <br \/>                 {method:'post', parameters:params});<br \/>}<br \/><\/pre>\n<p><\/code><br \/>3. Ah, that&#8217;s about it.. A short explanation: The target container&#8217;s contents is being replaced just before the call invocation with the &#8216;spinner&#8217; image, so it shows as &#8216;loading&#8217; until the call returns, and then the server side replaces it with the actual HTML result once it&#8217;s ready.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While exploring the Stripes framework, I spent a while looking at how to add the &#8216;spinner&#8217; indicator when your server side is processing a long request. Here&#8217;s a short summary of what I did to achieve that, hope it could help save someone a little time: 1. Select a spinner image \ud83d\ude42 I found this&hellip;&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[24,20,22,23],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-ajax","category-java","category-spinner","category-stripes"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"While exploring the Stripes framework, I spent a while looking at how to add the &#039;spinner&#039; indicator when your server side is processing a long request. Here&#039;s a short summary of what I did to achieve that, hope it could help save someone a little time:1. Select a spinner image :-) I found this cool\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"gadi\"\/>\n\t<meta name=\"google-site-verification\" content=\"DLlL0GJbP_qA1d7KlqKLvBJERDeissAuIEvTqeYz5O8\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/blog.lifshitz.net\/?p=29\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Gadi&#039;s Blog - A blog about technology, management, and stuff...\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Adding AJAX delay\/loading indicator using Java Stripes - Gadi&#039;s Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"While exploring the Stripes framework, I spent a while looking at how to add the &#039;spinner&#039; indicator when your server side is processing a long request. Here&#039;s a short summary of what I did to achieve that, hope it could help save someone a little time:1. Select a spinner image :-) I found this cool\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/blog.lifshitz.net\/?p=29\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2008-12-08T11:51:00+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2014-11-17T14:09:05+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Adding AJAX delay\/loading indicator using Java Stripes - Gadi&#039;s Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"While exploring the Stripes framework, I spent a while looking at how to add the &#039;spinner&#039; indicator when your server side is processing a long request. Here&#039;s a short summary of what I did to achieve that, hope it could help save someone a little time:1. Select a spinner image :-) I found this cool\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#blogposting\",\"name\":\"Adding AJAX delay\\\/loading indicator using Java Stripes - Gadi's Blog\",\"headline\":\"Adding AJAX delay\\\/loading indicator using Java Stripes\",\"author\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#organization\"},\"datePublished\":\"2008-12-08T13:51:00+02:00\",\"dateModified\":\"2014-11-17T16:09:05+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#webpage\"},\"articleSection\":\"ajax, java, spinner, stripes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.lifshitz.net\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?cat=20#listItem\",\"name\":\"java\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?cat=20#listItem\",\"position\":2,\"name\":\"java\",\"item\":\"https:\\\/\\\/blog.lifshitz.net\\\/?cat=20\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#listItem\",\"name\":\"Adding AJAX delay\\\/loading indicator using Java Stripes\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#listItem\",\"position\":3,\"name\":\"Adding AJAX delay\\\/loading indicator using Java Stripes\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?cat=20#listItem\",\"name\":\"java\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#organization\",\"name\":\"Gadi's Blog\",\"description\":\"A blog about technology, management, and stuff...\",\"url\":\"https:\\\/\\\/blog.lifshitz.net\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1#author\",\"url\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1\",\"name\":\"gadi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/57df3a2c5d92d221b0ac065f950d678df7002a3732bf62736d06621b8d7635df?s=96&d=retro&r=g\",\"width\":96,\"height\":96,\"caption\":\"gadi\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#webpage\",\"url\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29\",\"name\":\"Adding AJAX delay\\\/loading indicator using Java Stripes - Gadi's Blog\",\"description\":\"While exploring the Stripes framework, I spent a while looking at how to add the 'spinner' indicator when your server side is processing a long request. Here's a short summary of what I did to achieve that, hope it could help save someone a little time:1. Select a spinner image :-) I found this cool\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?p=29#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/?author=1#author\"},\"datePublished\":\"2008-12-08T13:51:00+02:00\",\"dateModified\":\"2014-11-17T16:09:05+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#website\",\"url\":\"https:\\\/\\\/blog.lifshitz.net\\\/\",\"name\":\"Gadi's Blog\",\"description\":\"A blog about technology, management, and stuff...\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.lifshitz.net\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Adding AJAX delay\/loading indicator using Java Stripes - Gadi's Blog","description":"While exploring the Stripes framework, I spent a while looking at how to add the 'spinner' indicator when your server side is processing a long request. Here's a short summary of what I did to achieve that, hope it could help save someone a little time:1. Select a spinner image :-) I found this cool","canonical_url":"https:\/\/blog.lifshitz.net\/?p=29","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"DLlL0GJbP_qA1d7KlqKLvBJERDeissAuIEvTqeYz5O8","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/blog.lifshitz.net\/?p=29#blogposting","name":"Adding AJAX delay\/loading indicator using Java Stripes - Gadi's Blog","headline":"Adding AJAX delay\/loading indicator using Java Stripes","author":{"@id":"https:\/\/blog.lifshitz.net\/?author=1#author"},"publisher":{"@id":"https:\/\/blog.lifshitz.net\/#organization"},"datePublished":"2008-12-08T13:51:00+02:00","dateModified":"2014-11-17T16:09:05+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/blog.lifshitz.net\/?p=29#webpage"},"isPartOf":{"@id":"https:\/\/blog.lifshitz.net\/?p=29#webpage"},"articleSection":"ajax, java, spinner, stripes"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.lifshitz.net\/?p=29#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net#listItem","position":1,"name":"Home","item":"https:\/\/blog.lifshitz.net","nextItem":{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?cat=20#listItem","name":"java"}},{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?cat=20#listItem","position":2,"name":"java","item":"https:\/\/blog.lifshitz.net\/?cat=20","nextItem":{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?p=29#listItem","name":"Adding AJAX delay\/loading indicator using Java Stripes"},"previousItem":{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?p=29#listItem","position":3,"name":"Adding AJAX delay\/loading indicator using Java Stripes","previousItem":{"@type":"ListItem","@id":"https:\/\/blog.lifshitz.net\/?cat=20#listItem","name":"java"}}]},{"@type":"Organization","@id":"https:\/\/blog.lifshitz.net\/#organization","name":"Gadi's Blog","description":"A blog about technology, management, and stuff...","url":"https:\/\/blog.lifshitz.net\/"},{"@type":"Person","@id":"https:\/\/blog.lifshitz.net\/?author=1#author","url":"https:\/\/blog.lifshitz.net\/?author=1","name":"gadi","image":{"@type":"ImageObject","@id":"https:\/\/blog.lifshitz.net\/?p=29#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/57df3a2c5d92d221b0ac065f950d678df7002a3732bf62736d06621b8d7635df?s=96&d=retro&r=g","width":96,"height":96,"caption":"gadi"}},{"@type":"WebPage","@id":"https:\/\/blog.lifshitz.net\/?p=29#webpage","url":"https:\/\/blog.lifshitz.net\/?p=29","name":"Adding AJAX delay\/loading indicator using Java Stripes - Gadi's Blog","description":"While exploring the Stripes framework, I spent a while looking at how to add the 'spinner' indicator when your server side is processing a long request. Here's a short summary of what I did to achieve that, hope it could help save someone a little time:1. Select a spinner image :-) I found this cool","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/blog.lifshitz.net\/#website"},"breadcrumb":{"@id":"https:\/\/blog.lifshitz.net\/?p=29#breadcrumblist"},"author":{"@id":"https:\/\/blog.lifshitz.net\/?author=1#author"},"creator":{"@id":"https:\/\/blog.lifshitz.net\/?author=1#author"},"datePublished":"2008-12-08T13:51:00+02:00","dateModified":"2014-11-17T16:09:05+02:00"},{"@type":"WebSite","@id":"https:\/\/blog.lifshitz.net\/#website","url":"https:\/\/blog.lifshitz.net\/","name":"Gadi's Blog","description":"A blog about technology, management, and stuff...","inLanguage":"en-US","publisher":{"@id":"https:\/\/blog.lifshitz.net\/#organization"}}]},"og:locale":"en_US","og:site_name":"Gadi's Blog - A blog about technology, management, and stuff...","og:type":"article","og:title":"Adding AJAX delay\/loading indicator using Java Stripes - Gadi's Blog","og:description":"While exploring the Stripes framework, I spent a while looking at how to add the 'spinner' indicator when your server side is processing a long request. Here's a short summary of what I did to achieve that, hope it could help save someone a little time:1. Select a spinner image :-) I found this cool","og:url":"https:\/\/blog.lifshitz.net\/?p=29","article:published_time":"2008-12-08T11:51:00+00:00","article:modified_time":"2014-11-17T14:09:05+00:00","twitter:card":"summary_large_image","twitter:title":"Adding AJAX delay\/loading indicator using Java Stripes - Gadi's Blog","twitter:description":"While exploring the Stripes framework, I spent a while looking at how to add the 'spinner' indicator when your server side is processing a long request. Here's a short summary of what I did to achieve that, hope it could help save someone a little time:1. Select a spinner image :-) I found this cool"},"aioseo_meta_data":{"post_id":"29","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_custom_url":null,"og_image_custom_fields":null,"og_image_url":null,"og_image_width":null,"og_image_height":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_image_url":null,"twitter_title":null,"twitter_description":null,"schema_type":"default","schema_type_options":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null,"created":"2026-07-21 07:49:45","updated":"2026-07-21 07:49:45"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/blog.lifshitz.net\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/blog.lifshitz.net\/?cat=20\" title=\"java\">java<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tAdding AJAX delay\/loading indicator using Java Stripes\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/blog.lifshitz.net"},{"label":"java","link":"https:\/\/blog.lifshitz.net\/?cat=20"},{"label":"Adding AJAX delay\/loading indicator using Java Stripes","link":"https:\/\/blog.lifshitz.net\/?p=29"}],"_links":{"self":[{"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":0,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=\/wp\/v2\/posts\/29\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.lifshitz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}