Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
| Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 14th, 2012, 04:18 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default To call a java class from javascipt and pass a variable to the java servelet too

function login(response, info){
if (response.authResponse) {
var accessToken = response.authResponse.accessToken;
userInfo.innerHTML = '<img src="https://graph.facebook.com/' + info.id + '/picture">' + info.name
+ "<br /> Your Access Token: " + accessToken;
button.innerHTML = 'Logout';
showLoader(false);
}
}

I have to pass the access token to a java servlet or java class how to do it
(UserService.java)
  #2 (permalink)  
Old February 23rd, 2012, 10:55 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Quote:
Originally Posted by prithagupta View Post
function login(response, info){
if (response.authResponse) {
var accessToken = response.authResponse.accessToken;
userInfo.innerHTML = '<img src="https://graph.facebook.com/' + info.id + '/picture">' + info.name
+ "<br /> Your Access Token: " + accessToken;
button.innerHTML = 'Logout';
showLoader(false);
}
}

I have to pass the access token to a java servlet or java class how to do it
(UserService.java)
My English is not very well.Do you know Ajax,it can make js pass the access token to a java servlet
  #3 (permalink)  
Old February 23rd, 2012, 11:40 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes i know ajax but can you tell me how to do it??
  #4 (permalink)  
Old February 24th, 2012, 11:40 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by prithagupta View Post
Yes i know ajax but can you tell me how to do it??
first,you need to create ajax engine:var xmlHttp = new XMLHttpRequest();it depends on your browser.
second:xmlHttp.open("get",url,true);
xmlHttp.send(null)
xmlHttp.onreadystatechange = callback;
function callback(){
if(xmlHttp.readyState == 4){ document.getElementById("id").innerHTML = xmlHttp.responseText;
}
}
actually,you can google or baidu,there are many things what you want
  #5 (permalink)  
Old March 9th, 2013, 08:39 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2013
Location: china
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mkl34367803
Default

Quote:
Originally Posted by 张松伟 View Post
first,you need to create ajax engine:var xmlHttp = new XMLHttpRequest();it depends on your browser.
second:xmlHttp.open("get",url,true);
xmlHttp.send(null)
xmlHttp.onreadystatechange = callback;
function callback(){
if(xmlHttp.readyState == 4){ document.getElementById("id").innerHTML = xmlHttp.responseText;
}
}
actually,you can google or baidu,there are many things what you want
are you kidding me ?i don't think he or her konw baidu.


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASSIGNING A JAVA SCRIPT VARIABLE TO A XSL VARIABLE SOMANATHAN10 XSLT 1 February 21st, 2007 04:26 AM
pass variable from jsp to java file ypsmag JSP Basics 0 November 1st, 2006 04:22 AM
pass variable in the same java file ypsmag Java Basics 0 November 1st, 2006 04:15 AM
pass java variable to xsl variable kathy1016cats XSLT 1 June 14th, 2006 06:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.