This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 60050
    
  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
Setting Up Ant with enviromental variables?
Need Help for implementing save as dialog box for downloading a folder not a file
Setting Up Ant with enviromental variables?
what should i do?
Calling constants from another file in JS