This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara 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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 61103
    
  66

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.