第一个为html文件的helloworld
<html>
<head>
<title>this is title</title>
</head>
<center>HelloWorld</center>
</html>
后面的是基于服务器的技术
第二个是用c语言写的CGI
#include <stdio.h>
void main()
{
printf("content-type:text/html/n/n");
printf("<center>HelloWorld</center>");
}
编译成helloworld.exe便可以通过http://XXX访问了。
第三个是用perl语言写的CGI
print "content-type: text/html/n/n");
print "<center>HelloWorld</center>");
不过这个不用编译,直接由perl解释器解释运行
第四个是用ASP实现,可以看出他比CGI简单多了
<%
str="HelloWorld"
%>
<center><%=str%></cneter>
第五个是JSP实现的,可以看出和ASP几乎是一样的。
<%
String str="HelloWorld";
%>
<center><%=str%></center>
ASP和JSP的区别是:ASP是解释执行的,而JSP是在第一次编译成
Servelet,以后就不用再编译,所以JSP比ASP快。
以上若有什么错误,还望指出。
<html>
<head>
<title>this is title</title>
</head>
<center>HelloWorld</center>
</html>
后面的是基于服务器的技术
第二个是用c语言写的CGI
#include <stdio.h>
void main()
{
printf("content-type:text/html/n/n");
printf("<center>HelloWorld</center>");
}
编译成helloworld.exe便可以通过http://XXX访问了。
第三个是用perl语言写的CGI
print "content-type: text/html/n/n");
print "<center>HelloWorld</center>");
不过这个不用编译,直接由perl解释器解释运行
第四个是用ASP实现,可以看出他比CGI简单多了
<%
str="HelloWorld"
%>
<center><%=str%></cneter>
第五个是JSP实现的,可以看出和ASP几乎是一样的。
<%
String str="HelloWorld";
%>
<center><%=str%></center>
ASP和JSP的区别是:ASP是解释执行的,而JSP是在第一次编译成
Servelet,以后就不用再编译,所以JSP比ASP快。
以上若有什么错误,还望指出。
博客展示了多种技术实现HelloWorld的示例。包括HTML文件,用C语言、Perl语言写的CGI,以及ASP和JSP实现。还指出ASP是解释执行,JSP首次编译成Servelet后无需再编译,JSP比ASP运行速度快。
1490

被折叠的 条评论
为什么被折叠?



