tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Januski, Ken" <kjanu...@phillynews.com>
Subject SOLVED: OT?:Can't include .js file on jsp page
Date Mon, 12 Jan 2004 18:33:45 GMT
Thanks to Merrill for pointing out that the problem was probably in the
javascript. By includining actual file, section by section, in jsp page I
was able to isolate some javascript errors that triggered the
requestDispatcher. I haven't figured out exactly why yet but at least I now
know where the problem is coming from.

Thanks to everyone for their suggestions,

Ken

-----Original Message-----
From: Merrill Cornish [mailto:merrill.cornish@earthlink.net]
Sent: Monday, January 12, 2004 12:43 PM
To: Januski,Ken
Subject: RE: OT?:Can't include .js file on jsp page controlled by front
co ntro ller servlet


Ken,

  One interesting "characteristic" of JavaScript is that if there is any
error, it quietly does nothing.  So, you may be correctly downloading it,
but it finds something wrong and does nothing.

  One way to attack the problem is to get a copy of the JavaScript file and
include it directly in your JSP page between <script> ... </script> tags
rather than downloading the .js file with <script src=...>.

  Once you have it in your JSP page, edit the JavaScript so that each
JavaScript function is individually enclosed in a <script> ... </script>
pair rather than having the whole thing in a single <script> ... </script>
tag pair.  JavaScript merges all of the individual tag pair together as if
it were one big declaration EXCEPT an error in one function now does not
stop other functions from executing.

   Finally, use alert(...); statements at the top fo the various JavaScript
functions to see which one is refusing to execute.  That will tell you which
function(s) have the error.  You can then start commenting out blocks of
code until you isolate the failing statement.

   Of course, it would be easier to use a JavaScript debugger, but I'm not
familiar with them.


Merrill

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message