I am a begginer of Java Servlet, I have a test
servlet as follow:
//////////////////////////////////////////////////////
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Atest extends HttpServlet
{
public void doGet(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException
{
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
// to do: code goes here.
out.println("<HTML>");
out.println("<HEAD><TITLE>Atest
Output</TITLE></HEAD>");
out.println("<BODY>");
out.println("<form action='Atest' method='post'
enctype='multipart/form-data'>");
out.println("<p><input type=file name=file1 size=50
></p>");
out.println("<p><input type=\"submit\"
value=\"Upload\"></p>");
out.println("</BODY>");
out.println("</HTML>");
}
public void doPost(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException, IOException
{
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
out.println("<HTML>");
out.println("<HEAD><TITLE>Atest
Output</TITLE></HEAD>");
out.println("<BODY>");
out.println("Congratulate!");
out.println("</BODY>");
out.println("</HTML>");
}
}
////////////////////////////////////////////////////
when debugged in Visual cafe3.0, it works well. but
when I put the class file in my java
server(windows98+jdk1.4+jswdk1.0.1), it does not work.
1.If I input nothing in the file box, it works well.
Once I input a file name, IE gives the wrong
messeg:"Can not find server or DNS wrong".
2.If the property(enctype='multipart/form-data') of
the form is deleted, the test program goes well on my
java server.
Can anybody tell me why? Is something wrong with my
java server?
Thanks!
_________________________________________________________
Do You Yahoo!? ��¼����Ż�����! http://mail.yahoo.com.cn
<font color=#6666FF>���ģ����ƣ����ˣ�û���ɣ���������ɣ�</font>����
�Ż�ȫ��������! http://cn.chat.yahoo.com/c/roomlist.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