Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript var inside JSP Scriptlets

 
Chua Keng Guan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<script type="text/JavaScript">

var a = 1;
<% JavaFile.staticInt = a %>

</script>

The above example will cause a error stated that varible a is not found(no such symbol). Do anyone know how to solve this problem. Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP is server side script, so you won't access Javascript variables. Try to figure out another way to get the needed data.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64694
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a fundamental misunderstanding of what JSP technology is all about.

Perhaps this article will be helpful.
[ October 17, 2006: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic