java applet in Opera not sending POST values

This JavaApplet method is suppose to send some POST variables to a PHP script and listen for response.
Works fine in FireFox.
In opera even though it is able to get response from PHP, PHP never gets any of the POST variables.

How can i fix that.
Applet is called through
<applet name="RegisterInstallation" code="UserRegister.class" height="251" width="271"></applet>

I never thought java applets would act differently among browsers.

Thank you.
private void sendUserInfo(String userName, String userPassword, String macAddress) {
        // construct data
        String data = URLEncoder.encode("UserName", "UTF-8") + "=" + URLEncoder.encode(userName, "UTF-8");
        data += "&" + URLEncoder.encode("Password", "UTF-8") + "=" + URLEncoder.encode(userPassword, "UTF-8");
        data += "&" + URLEncoder.encode("MAC", "UTF-8") + "=" + URLEncoder.encode(macAddress, "UTF-8");
        // Send data
        URL url = new URL(this.registerLocation);
        URLConnection conn = url.openConnection();
        OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
        // Get the response
        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line;
        while ((line = rd.readLine()) != null) {
      } catch (Exception e){

Open in new window

LVL 11
AlexanderREnterprise Web DeveloperAsked:
Who is Participating?
rrzConnect With a Mentor Commented:
You could try dressing up your request. Maybe it will help.
HttpURLConnection httpURLConnection =(HttpURLConnection)url.openConnection();
then try some or all of these lines.
Kevin CrossChief Technology OfficerCommented:
See if this helps (Opera uses JRE from system instead of plug-in):
AlexanderREnterprise Web DeveloperAuthor Commented:
I see the difference. Interesting.

But it still does not answer my queston as to why POST data send would not work.  
I am really new to java and not sure where to begin looking.   How can I rewrite this method propperly so it works the same in both applet (non-opera) and JRE direct call (opera)?

Thank you.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Kevin CrossChief Technology OfficerCommented:
Following the instructions to set the JRE for Opera, see which version is configured there and then check with JRE is active for use in the Java Plugin.  Can also check the security settings while in the Opera settings.
AlexanderREnterprise Web DeveloperAuthor Commented:
That does it!
AlexanderREnterprise Web DeveloperAuthor Commented:
Works just the way it should!  Thanks a lot.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.