Hi Jinfeng,
I hope I understand your problem right.
If you wish to call a servlet in your html file all you need to do is
include the following:
<servlet code = "<path><filename.class>">
</servlet>
Save this file i.e. your html file as a .shtml file. But, make sure that you
are invoking the doGet method in your class file as I faced problems trying
to invoke the doPost method.
So what your file will actually look like will be:
<html>
<servlet code = "filename.class">
</servlet>
</html>
You do not need <head> or <body> tags as you can call those thru your
servlet.
Hope this helps.
Regards
Cherag
----- Orig
inal Message -----
From: Jinfeng Ni <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 18, 2000 8:23 AM
Subject: Invoke a servlet in html
hi,
I meet a problem. I want to run a servlet when user open
one html. I edit the html file like this:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<script language="JavaScript" src="/servlet/Hello">
</script>
</body>
</html>
==========================================
But it failed. I was told that there is a syntax error!
How to implent this request?
Any help will be appreciate!
Jeff Ni
_____________________________________________
263������--�й��˵����ϼ� http://www.263.net
���ʡ���ѡ�����ʡ�����ѣ��충�������ӿ��http://www.soim.com
�����ţ��㣬��������Ʒ��http://www.thepoints.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html