JavaÖ®Servlet¿ª·¢
±¾ÎÄ°üÀ¨:
A: servletÔ´ÂëʵÀý
B: servlet²¿Êð
C: ¿Í»§¶ËÔ¶³Ìµ÷ÓÃ
D: servlet¿ª·¢µ÷Óù¤¾ß
A: servletÔ´ÂëʵÀý
package com.viewlinecn.userlogin.www.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.viewlinecn.userlogin.util.OrganizeXML;
/**
* ÓÎÏ·¸öÐÔ»¯µÇ¼ÈÏÖ¤·þÎñ
* @author cairenxi * @version 1.0
*/
public class LoginGameServlet extends HttpServlet {
private final static long serialVersionUID = -200904271326L;
private static Log log = LogFactory.getLog(LoginGameServlet.class);
public void init() throws ServletException {
//no code
} public
void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
// Ìí¼Ó´úÂë
} public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
// Ìí¼Ó´úÂë
}
}
B: servlet²¿Êð
com.viewlinecn.userlogin.www.servlet.LoginGameServlet ;
/servlets/login.html
C: ¿Í»§¶ËÔ¶³Ìµ÷ÓÃ
URL: http://host:port/context/servlets/login.html
D: servlet¿ª·¢µ÷Óù¤¾ß
package com.viewlinecn.common.http.util;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import javax.servlet.http.HttpServletRequ
Ïà¹ØÎĵµ£º
Java Web Start ÊÇ°ïÖú¿Í»§»ú¶ËÓ¦ÓóÌÐò¿ª·¢µÄÒ»¸öм¼Êõ£¬ËüµÄ¶ÀÌØÖ®´¦ÔÚÓÚ½«Äú´Ó¹ØÐÄ¿Í»§»úÊÇÈçºÎÆô¶¯µÄ£¨´Ó Web ä¯ÀÀÆ÷»òÊÇ×ÀÃ棩Öнâ·Å³öÀ´¡£ÁíÍ⣬¸Ã¼¼ÊõÌṩÁËÒ»¸öʹ Web ·þÎñÆ÷ÄܶÀÁ¢µÄ·Ö·¢ºÍ¸üпͻ§»ú´úÂëµÄ¼¯ºÏ²¿Êð·½°¸¡£
Java Web Start ÊÇÒ»¸öÈí¼þ¼¼Êõ£¬Ëü°üº¬ÁË applet µÄ¿ÉÒÆÖ²ÐÔ¡¢Servl ......
ÕâƪÎÄÕ¶ԳéÏóÀàºÍ½Ó¿Ú˵µÄºÜÏêϸ£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú.
¡¡¡¡abstract classºÍinterfaceÊÇJavaÓïÑÔÖжÔÓÚ³éÏóÀඨÒå½øÐÐÖ§³ÖµÄÁ½ÖÖ»úÖÆ£¬ÕýÊÇÓÉÓÚÕâÁ½ÖÖ»úÖƵĴæÔÚ£¬²Å¸³ÓèÁËJavaÇ¿´óµÄÃæÏò¶ÔÏóÄÜÁ¦¡£abstract classºÍinterfaceÖ®¼äÔÚ¶ÔÓÚ³éÏóÀඨÒåµÄÖ§³Ö·½Ãæ¾ßÓкܴóµÄÏàËÆÐÔ£¬ÉõÖÁ¿ÉÒÔÏ໥Ìæ»»£¬Òò´ËºÜ¶à¿ª·¢ÕßÔÚ½øÐг ......
ʹÓÃservletÀ´ÏÂÔØÎļþ£¬ÆäÔÀí·Ç³£¼òµ¥£¬Ö»ÒªµÃµ½ÎļþµÄÊäÈëÁ÷£¨»òÏàÓ¦×Ö½Ú£©£¬È»ºóдÊä³öÁ÷¼´¿É¡£ÏÖ¾ÍÆäÖеļ¸¸öϸ½ÚÎÊÌâÕ¹¿ª£º
1. MIMEÀàÐ͵ÄÉèÖãº
Web ä¯ÀÀÆ÷ʹÓà MIME ÀàÐÍÀ´Ê¶±ð·Ç HTML Îĵµ£¬²¢¾ö¶¨ÈçºÎÏÔʾ¸ÃÎĵµÄÚµÄÊý¾Ý¡£
ÀýÈçEXCELÎļþµÄ MIME ÀàÐÍÊÇ "application/vnd.ms-excel "¡£ÒªÓÃservlet À´´ò¿ªÒ» ......
ÓÃjava´´½¨XmlµÄ4´óÀࣺ
Element£º½ÚµãÀà
AttributeÊôÐÔÀà
Document£ºÖ¸µÄ¾ÍÊÇÎĵµÀà
XMLOutput£ºÊä³öÀà
´ËÀàÊÇÓÃjava½¨Á¢Ò»¸öxmlÎļþ
public class TestJdom {
//´´½¨XML£¨Ä£ÐÍ£©dom
public static void main(String[] args) {
  ......
TimerλÓÚjava.utilÏÂÃ棬һ°ã½ÐËûjava¼ÆʱÆ÷¡£
javaAPIµÄ½âÊÍÈçÏÂ:
Ò»ÖÖÏß³ÌÉèÊ©£¬ÓÃÓÚ°²ÅÅÒÔºóÔÚºǫ́Ïß³ÌÖÐÖ´ÐеÄÈÎÎñ¡£¿É°²ÅÅÈÎÎñÖ´ÐÐÒ»´Î£¬»òÕ߶¨ÆÚÖظ´Ö´ÐС£
ÏÈÀ´¿´¿´Ð§¹û£º
1.Éè¼Æ¼ÆʱÆ÷
import java.io.IOException;
import java.util.Calendar;
import java.util.Timer;
public class TimerTest {
......