[英]Translating php code to jsp
$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 谁能告诉我jsp上的类似功能
http_build_query() is php function, similar function in Jsp is what? http_build_query()是php函数,在Jsp中类似的函数是什么?
stream_context_create() also php function stream_context_create()也是php函数
With scriptlets you can call java libraries in jsps. 使用脚本,您可以在jsps中调用Java库。
For http_build_query , the analog in Java is the URLEncoder class. 对于http_build_query ,Java中的类似物是URLEncoder类。 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 . 对于stream_context_create ,我想您想向服务器发送http请求,Java中的类似物是Java.net 。 See this post for mini a torial . 有关迷你教程,请参见此帖子 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.