1
$postdata = http_build_query(array('name' => $album_name,'message' => $album_description));
$opts = array('http' =>array( 'method'=> 'POST',
                              'header'=>'Content-type: application/x-www-form-urlencoded',
                              'content' => $postdata));
$context  = stream_context_create($opts);

Could anyone tell me similar function on jsp

http_build_query() is php function, similar function in Jsp is what?

stream_context_create() also php function

Bakudan
  • 17,636
  • 9
  • 48
  • 69

1 Answers1

1

With scriptlets you can call java libraries in jsps.

For http_build_query, the analog in Java is the URLEncoder class. Here's a simple tutorial on how to use it.

For stream_context_create, I guess you want to send an http request to a server, the analog in Java is Java.net. See this post for mini a torial.

Community
  • 1
  • 1
Jeune
  • 3,380
  • 5
  • 40
  • 53