Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes Converting a javascript variable to Java variable. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Converting a javascript variable to Java variable." Watch "Converting a javascript variable to Java variable." New topic
Author

Converting a javascript variable to Java variable.

Sindhura Lakshmi
Greenhorn

Joined: Jun 18, 2009
Posts: 13
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Jan 10, 2002
Posts: 60780
    
  65

You need to understand how JSP works. Please read this article to understand why that's impossible.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting a javascript variable to Java variable.
 
Similar Threads
what should i do?
Setting Up Ant with enviromental variables?
Calling constants from another file in JS
Need Help for implementing save as dialog box for downloading a folder not a file
Setting Up Ant with enviromental variables?