aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Servlet is Not Requested After Initial Request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Servlet is Not Requested After Initial Request" Watch "Servlet is Not Requested After Initial Request" New topic
Author

Servlet is Not Requested After Initial Request

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
I have the following js that is called several places in my jsp files however the sevrlet only responds on the initial call.

js code


Servlet code
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Have you used a debugger to determine if the load method is actually being called multiple times?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Bear Bibeault wrote:Have you used a debugger to determine if the load method is actually being called multiple times?


The alert message pops up every time it is just the load that does not fire but on the initial call. It is like the servlet gets cached but I thought the code I have in my servlet would prevent this.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

First, drop the alerts -- they are not a valid debugging mechanism. Open the JavaScript console and use console.log() to log to the console without interrupting the execution thread.
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Bear Bibeault wrote:First, drop the alerts -- they are not a valid debugging mechanism. Open the JavaScript console and use console.log() to log to the console without interrupting the execution thread.


I am using WebSphere as my development environment. I run in the IE8 browser. Everything in my app run in div tags so the code is difficult to see runing. I have started the app, opened the Developer Tools in IE, clicked the Script option. Where do I go from there?
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Bear Bibeault wrote:First, drop the alerts -- they are not a valid debugging mechanism. Open the JavaScript console and use console.log() to log to the console without interrupting the execution thread.


Never mind. Sorry but I found my mistake. After initialy loading the div tag which had a div tag embeded(every thing worked) I later reloaded the div tag but did not include embeded div tag that held the progress bar.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

But keep in mind the thing about alerts. Don't use them. They interrupt the execution thread and are a poor way to debug.
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1391
Bear Bibeault wrote:But keep in mind the thing about alerts. Don't use them. They interrupt the execution thread and are a poor way to debug.


Thanks, I still have so much to learn.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Servlet is Not Requested After Initial Request
 
Similar Threads
How to Close Connections made In Servlet
Image preview with upload
Dependable dropdowns in jsp(struts2)
HTTP method POST is not supported by this url
Session in HTTPServlet