cancel
Showing results for 
Search instead for 
Did you mean: 

Passing parameters to another application

Former Member
0 Kudos

I want to pass parameters from web dynpro to another application using the post method (Get method has a maximum length of 2048,and that not enough).

Another option to solve the problem is to open a stream and write directly to the client an html text.

Is one of the options above possible?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Assuming your question is about Java WDP:

You can post to another application using this example:

try {
        // Construct data
        String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
        data += "&" + URLEncoder.encode("key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");
    
        // Send data
        URL url = new URL("http://hostname:80/cgi");
        URLConnection conn = url.openConnection();
        conn.setDoOutput(true);
        OutputStreamWriter wr = new OutputStrea
mWriter(conn.getOutputStream());
        wr.write(data);
        wr.flush();
    
        // Get the response
        BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String line;
        while ((line = rd.readLine()) != null) {
            // Process line...
        }
        wr.close();
        rd.close();
    } catch (Exception e) {
    }

However, there are other ways to share data between portal applications, e.g. by using portal eventing.

Good luck!

Roelof

Answers (0)