This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting a javascript variable to Java variable.

 
Sindhura Lakshmi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I m trying to convert my javasciprt variable to java String .

var file = document.getElementById("photo_releasefile").value;
alert(file);
<%
String path =file;
System.out.println("sfkhs"+path);%>

But i m getting file (var file) not resolved .Please help .
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't work like that-JavaScript runs on the client after *all* the Java-based code has rendered the output HTML.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to understand how JSP works. Please read this article to understand why that's impossible.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic