RE:¾ÖÇø´°ú CGI


[ Follow Ups ] [ Post Followup ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

Posted by À±°æ±¸ on October 30, 1997 at 14:57:02:

In Reply to: Java AppletÀ¸·Î ÀÛ¼ºÇÑ È­¸é¿¡¼­ ¹öÆ°À» ÅëÇØ cgi±âµ¿ÇÏ´Â ¹æ¹ý? posted by Á¤µ¿½Ä on October 30, 1997 at 14:02:03:

Å×½ºÆ® ¼Ò½ºÀÔ´Ï´Ù.
¹°·Ð CGI URL¿¡ Àִ ȣ½ºÆ®´Â ¾ÖÇø´ÀÌ ÀÖ´Â À¥ ¼­¹öÀÇ È£½ºÆ®¿Í °°¾Æ¾ß°Ú½À´Ï´Ù.
ÀÌ ¼Ò½º°¡ ÇÏ´Â ÀÏÀº CGI¸¦ ±¸µ¿½ÃÄÑ ±× °á°ú¸¦ ÅؽºÆ®·Î ¹Þ¾Æ¿À´Â °ÍÀÔ´Ï´Ù.
¸¸¾à ´Ü¼øÈ÷ CGI¸¸ ±¸µ¿ÇÏ¿© ±× °á°ú ÆäÀÌÁö·Î À̵¿ÇÏ°í ½Í´Ù¸é
getAppletContext().showDocument(CGIURL);°ú °°ÀÌ ¾ÆÁÖ °£´ÜÇÏ°Ô ±¸ÇöÇÒ ¼ö ÀÖ½À´Ï´Ù.


try {
byte b[];
URLConnection cgiURL = new URL(getParameter("CGIURL")).openConnection();
cgiURL.connect();
System.out.println("CONTENT_TYPE>"+cgiURL.getContentType());
int len=cgiURL.getContentLength();
System.out.println("CONTENT_LEN>"+len);
if (len<0) {
InputStream is=cgiURL.getInputStream();
b=new byte[1024];
is.read(b,0,1024);
}
else {
BufferedInputStream is=(BufferedInputStream)cgiURL.getContent();
b=new byte[len];
is.read(b);
}
System.out.println("CONTENT>");
System.out.println(new String(b)); // this constructor is only supported in JDK 1.1 and above
System.out.println("END>");
} catch (Exception e) {
System.out.println("CGI connection error"+e.toString());
}



Follow Ups:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ Follow Ups ] [ Post Followup ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]