Skip to Content
author's profile photo Former Member
Former Member

Open URL connection within applet to BSP page

Hi,

i have the following scenario:

- A BSP page contains an applet with use a jar-archive.

- The user enter some messages on the applet.

- A java class (of the jar archive) tries to open the URL of the applet to send the user input for further processing.

The last step fails without an error message.

I've activate debug modus on the server but nothing happened. Only at the beginning when the HTML page is loaded the debug window opens. (Each request to this page will switch to debug mode.)

If I copy myURL into a browser then it functioned.

Any thoughts are appreciated,

Andy

____________________________

A snippet of my code:

try {

myConnection = (HttpURLConnection)myURL.openConnection();

} catch (IOException e1) {

//do error handling

return false;

}

//configure connection

myConnection.setDoOutput(true);

myConnection.setDoInput(true);

try {

gcaConnection.connect();

out = gcaConnection.getOutputStream();

} catch (IOException e1) {

//do error handling

return false;

}

String send = "Hallo";

try {

out.write(send.getBytes());

out.flush();

out.close();

} catch (IOException e1) {

//do error handling

return false;

}

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 28, 2005 at 08:35 PM

    I've found a solution for my own.

    Add this block to the end:

    //send data thru reading input stream !!!

    try {

    InputStream in = myConnection.getInputStream();

    in.close();

    } catch (IOException e1) {

    //do some error handling

    return false;

    }

    A more detailed explanation can be found here:

    http://www.javaworld.com/javaworld/jw-03-2001/jw-0323-traps.html

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.