第一个为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快。
以上若有什么错误,还望指出。