?
Solved

register a SESSION variable using Java

Posted on 2006-05-30
6
Medium Priority
?
183 Views
Last Modified: 2010-03-31
currently i have this code that launches a PHP page and send username data: "personal.php?username=xyz".

is there any way to register a SESSION first, then launch my PHP page?  this JAVA code is run from an APPLET.

package org.pegasus.intranet.networking.tools ;
import java.awt.BorderLayout ;
import java.awt.Dimension ;
import java.net.URL ;
import java.net.URLEncoder ;
import javax.swing.JApplet ;
public class LDAPConnector extends JApplet {  
    public LDAPConnector() {}
    public void start() {
        try {
            this.getAppletContext().showDocument( new URL( "http://192.168.0.2/admin/personal/personal.php?" + URLEncoder.encode( "username", "UTF-8" ) + "=" + URLEncoder.encode( System.getProperty( "user.name" ), "UTF-8" ) ), "_self" ) ;
        } catch ( Exception ex ) {
            ex.printStackTrace() ;
        }
    }
}
0
Comment
Question by:ellandrd
  • 3
  • 3
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 16790006
>>is there any way to register a SESSION first

Not sure what you mean. The server is in control of sessions, not the client
0
 
LVL 16

Author Comment

by:ellandrd
ID: 16790054
sorry i just realised what i said... lol its ok, i have solved the issue using PHP...
0
 
LVL 16

Author Comment

by:ellandrd
ID: 16790066
what do you use to create your java apps, since you siad to me earlier not to rely on IDE's.  answer this here to save me opening another thread and i'll award you the 500 points from this one...
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 16790085
Well i use Eclipse, but i don't *rely* on it ;-) AFAIK Netbeans has a nasty habit of 'knowing better than the programmer'
0
 
LVL 16

Author Comment

by:ellandrd
ID: 16790110
thank you!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16790129
:-)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question