Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to include javascript in jsp

 
Aashish k Dalmia
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to include javascript in jsp.
I tried many ways to include javascript in jsp but I am not seeing output of javascript in tomcat log files
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You won't. Tomcat runs on the server, JavaScript runs on the client.

How are you creating "output" in JavaScript?
 
Aashish k Dalmia
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In javascript I tried log, alert etc.
But I still don't see the message in tomcat log file.
Aashish Dalmia
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aashish DalmiaDenver wrote:In javascript I tried log, alert etc.
But I still don't see the message in tomcat log file.

As Bear said, you can't see alert message in tomcat log. you should read about firebug(in case you use Firefox browser) . if you try to see a scope variable's value, log/print on action or servlet classes.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64824
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aashish DalmiaDenver wrote:But I still don't see the message in tomcat log file.

Read my reply again!

You obviously don't understand what JSP is and how it operates. I'd recommend reading this article.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic