This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes Java embedded in .JS file not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Java embedded in .JS file not working

Michael Stitch
Greenhorn

Joined: Nov 09, 2011
Posts: 4
Hi:
In my .jsp file I included a JS file 'abc.js'. This .js file has embedded java code to retrieve data value from a java class. For some reason Tomcat does not like the embedded java code. I was told that I have to change the Tomcat configuraiton to allow pasrsing Java inside the JSP .js file. Can someone tell me how do I configure Tomcat to do that?

abc.js -

function displaySession(){
document.getElementById("update_field" ).style.display = "<%=student.getUpdateField()%>";

Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

Please do not post the same question more than once.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: Java embedded in .JS file not working