Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-08-2008, 07:44 PM   #1
CheckersMcGavern
Registered User
 
Join Date: Dec 2007
Posts: 28
Default Flash front-end JSP issues

Well, I'm not sure if it's Flash, or JSP... but considering I know less JSP than I do Actionscript, I assume that's the problem.

I'm pretty much creating a Flash log-in for my site. Upon pressing the submit button Flash sends the text field to JSP, then JSP takes the required info from the server and compares the 2. If they are the same, it prints &comparej=true&. if not, it's prints &comparej=false&. And I have an else statement that's meant to cover anything else that might get thrown at me.

I checked out the JSP and had it print the information it's getting from Flash.... and it's giving me a null value. I'm assuming this means that somehow I'm not able to get the information I want from Flash.

Alright, enough chatter, here's the code. First Flash: This is the code I have set up on the submit button.
Code:
on (release) {
	regVars = new LoadVars();
			regVars.unamef = uName.text;
			regVars.upassf = userPassword.text;
			regVars.sendAndLoad("login.jsp", regVars, "POST");
			regVars.onLoad = Compare;
			
		function Compare() { 
			
		if (regVars.comparej == "true"){
				testtext.text = "It says true";
		}else if (regVars.comparej == "false"){
				testtext.text = "It says false";
			}
		 else{
			 testtext.text = "Oh crap";}
	}
}
And here is the JSP:
Code:
<%@ page contentType="text/html; charset=utf-8" language="java" 

import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<%
String namef = "";
namef = request.getParameter("unamef");

String passf = "";
passf = request.getParameter("upassf");


//mysql strings for logging in with, specifying the business db root is the user, 

mysql the password
String host="youcannothavemyinfohere";
String user="idontwanttogiveyouthis";
String pass="nothingtoseehere";
String db="blahblahblah";
String conn;

//specifically loads the connector j driver and logs into mysql
Class.forName("com.mysql.jdbc.Driver");
conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user  
+ "&password=" + pass;
Connection Conn = DriverManager.getConnection(conn);
Statement SQLStatement = Conn.createStatement();

String Query = "SELECT * FROM register WHERE id = '1';";
ResultSet SQLResult = SQLStatement.executeQuery(Query);
	SQLResult.first();

	String namej = SQLResult.getString("name");
//out.println("Your Username is: "+namej);
out.println("&namebackj="+namej+"&");

	String passj = SQLResult.getString("pass");
//out.println("Your Username is: "+passj);
out.println("&passbackj="+passj+"&");

if(namef == namej){
	out.println("&comparej=true&");
} else if(namef != namej){
	out.println("&comparej=false&");
} else{
	out.println("&comparej=null&");
}
out.println("<br/>");
out.println("|" + namef + "|<br/>|" + namej + "|");
%>

<body>
</body>
</html>
As far as I can tell, the only issue is that the info from Flash is showing Null. Oh, and don't worry about the cod for the password confirmation. Right now I just want name confirmation. I can copy the code for the name and alter it for the password.

Please, any help is appreciated. Thanks!
CheckersMcGavern is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash player issues (possibly related to as) euanuk ActionScript 2.0 7 04-05-2007 04:06 AM
Flash and AS browser issues SCook ActionScript 2.0 4 12-19-2005 03:14 PM
CyanBlue's 5000th Post - Useful Threads List CyanBlue Projectors and CDs 104 02-25-2005 01:13 PM
various mac related flash plugin issues seengee ActionScript 1.0 (and below) 5 06-02-2004 03:52 PM


All times are GMT. The time now is 12:16 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.