-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Peng,
On 4/29/13 10:05 AM, qingtao peng wrote: > uc.setRequestProperty("Content-type","application/xwww-form-urlencoded"); I > think you want: application/x-www-form-urlencoded > res.setContentType("text/html;charset=GB2312"); Why not use UTF-8 like you did in the Applet? What you have done is not wrong and it should work, but it does seem a little odd to use different character encodings in different places. > I have started the apache-tomcat-7.0.32 server ,then I have typed > the network address of DbApplet.htm in the address field of the > browser.I click on the button in the Applet,but receive > java.io.FileNotFoundException error.The error is > java.io.FileNotFoundException: > http://localhost:8080/Servlet/DbServlet.Where do I place DbServlet > ? The servlet spec says that all servlets need to be in a package. So you should have a "package" statement at the top of your .java file, then re-compile. > That is, which directory do I place under in > apache-tomcat-7.0.32. Assuming your package is "my.pkg", then you want your .class file here: .../mywebapp/WEB-INF/classes/my/pkg/DbServlet.class > What is the network address of this Servlet .I thank for helps. Network address (hostname) will be wherever you configured Tomcat to listen (localhost? www.foo.com?). The URL will depend upon how you have mapped the servlet in web.xml. Have you done that? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJRfotFAAoJEBzwKT+lPKRYOLMP/0XuXo5m06m6cXUfv90Ngh+U Vpy4L9y8WCWpHthtJqxk4EDRLT1K0Y5hV6cW0S7BzeH9ynh2VaKVvcWMR3KPcwts Pc60/TUMj7qGLzXkTfBxxUnWGzY6fQLq4KRJdiHDQvycnw/KwYbM1FjDU9PjG2vi yeEZQhEqMrP+fHCq8bYLAH+nuqngIGt59HGlN+1Umz5rsguSu6uq/ymaXUYEzyXZ k1lqDwKSTGn7x4LD+AOqzJxH549bMjFVqexE5Fw4yFCfxChAP7zQwnDhL1jkKcsB TXZJKQ5wNqQmHYg/C/9Cf+jKg7wmF6nEyw3FB4zDcYhKnGXaBBq2S8zF61Y8wKq3 QPkbyMfC8zPivXC1Jx28TyDJVQ81SLyKGB9JYfLZSuGvpN3rEV5sXOVrwKZw4+D7 mRYrwCYshm2/ueFALPXEjZbbAQHiXSqISDSdiMxYbIazMOCgxwcWcBfh7Rd2/g5+ rWU/xDdM0rUaIEkRVfA5bVQg9zNOqqoZFe7aEFNlBK0Y02LY2G9Bi2VtrfVMVnHo gXxf0efIn7fyI9ajsh1JFm/f+NxKvZissEPqDRr7pWV0qyqcr8YfErrPT6jYMPl9 lGSF2RIFXO2zaxJ2x6pwnLxWl/EYXxayFPqoCQXTw3lBRLaCeVG+Ftw+l8ni+Gm7 aIzoBlfT46MVINdwePvB =UAT7 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org