jsp»ù´¡Ëٳɾ«»ª½²½â
ServletÈý¸öÒªËØ:
1.±ØÐë¼Ì³Ð×ÔHttpServlet
2.±ØÐëʵÏÖdoGet()»òÕßdoPost()
3.±ØÐëÔÚweb.xmlÖÐÅäÖÃServlet
<servlet>
<servlet-name> </servlet-name>
<servlet-class> </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> </servlet-name>
<url-pattern> </url-pattern>
</servelt-mapping>
HttpServeltRrequest:ÇëÇó¶ÔÏó
getParameter():»ñµÃ±íµ¥ÔªËصÄÖµ
getAttribute():»ñµÃrequest·¶Î§ÖеÄÊôÐÔÖµ
setAttribute():ÉèÖÃreqeust·¶Î§ÖеÄÊôÐÔÖµ
setCharacterEncoding():ÉèÖÃ×Ö·û±àÂë
HttpSerletResponse:ÏàÓ¦¶ÔÏó
sendRedirect():ÍⲿÌøת
getWriter():»ñµÃÊä³öÁ÷¶ÔÏó
setContentType("text/html; charset=utf-8"):ÉèÖÃÏàÓ¦ÄÚÈݸñʽºÍ±àÂë
ËÄÖֻỰ¸ú×Ù·½Ê½:
1.Session
HttpSession session = request.getSession();
session.setAttribute("name", "zhangsan");
session.setAttribute("pwd", "aaa");
String name = (String) session.getAttribute("name");
2.cookie:
//´´½¨Cookie
Cookie cookie = new Cookie("name", "zhangsan");
//ÉèÖÃCookieµÄ³¬Ê±Ê±¼ä
cookie.setMaxAge(24 * 60 * 60 *60);
//°ÑCookie·¢Ë͵½¿Í»§¶Ë
response.addCookie(cookie);
//µÃµ½¿Í»§¶Ë·¢Ë͵ÄCookie
Cookie [] cookies = request.getCookies();
for(int i=0; i <cookies.length; i++) {
Cookie temp = cookies;
String key = temp.getName();
String value = temp.getValue();
}
3.Òþ²Ø±íµ¥Óò
<input type="hidden" name="name" value="zhangsan" />
request.getParameter("name");
4.UrlÖØд
ÎʺŴ«²Î
LoginServlet?username=zhangsan&pwd=123
String name = request.getParameter("username");
String pwd =request.getPareameter("pwd");
ÄÚ²¿Ìøת:
LoginServlet
request.getRequestDispatcher("index.jsp").forward(request, resposne);
ÍⲿÌøת:
response.sendRedirect("index.jsp");
ÄÚ²¿ÌøתÊÇÒ»´ÎÇëÇóºÍÒ»´ÎÏìÓ¦
ÍⲿÌøתÊÇÁ½´ÎÇëÇóºÍÁ½´ÎÏìÓ¦
ServletContext:ServletÉÏÏÂÎĶÔÏó
ËüÊÇÒ»¸ö¹«¹²ÇøÓò,¿ÉÒÔ±»ËùÓеĿͻ§¶Ë¹²Ïí
setAttribute():Ïò¹«¹²ÇøÓòÀï·ÅÈëÊý¾Ý
getAttribute():´Ó¹«¹²ÇøÓòÀïÈ¡
Ïà¹ØÎĵµ£º
±êÇ©¿âTaglib
±êÇ©±»¶¨ÒåºÍ·Ö²¼ÔÚÒ»¸ö³ÆΪ±êÇ©¿âµÄ½á¹¹ÖУ¬Ò»¸ö±êÇ©¿âÊÇÓÉÔªÐÅÏ¢ºÍÀà×é³ÉµÄ¼¯ºÏ£º
1.±êÇ©´¦ÀíÆ÷£ºÊµÏÖ¶¨ÖƱêÇ©¹¦ÄܵÄJavaÀà¡£
2.±êÇ©¸½¼ÓÐÅÏ¢£¨TEI£©£ºÏòJSPÈÝÆ÷Ìṩ±ß¼ÒÔÈ·ÈϱêÇ©ÊôÐԺʹ´½¨±äÁ¿µÄÀà¡£
3.±êÇ©¿âÃèÊöÆ÷£¨TLD£©£ºÃèÊöµ¥¸ö±êÇ©ºÍÕû¸ö±êÇ©¿âÊôÐÔµÄXMLÎĵµ¡£
±êÇ©´¦ÀíÆ÷ºÍ±êÇ©¸½¼ÓÐÅÏ¢Ðè ......
1.°²×°jdk(°æ±¾6u7);
¡¡¡¡2.ÅäÖÃjdk»·¾³±äÁ¿(°²×°Ä¿Â¼:D:\tools\java\jdk1.6.0_07):
¡¡¡¡1). JAVA_HOME = D:\tools\java\jdk1.6.0_07;
¡¡¡¡2). PathµÄ×îÇ°Ãæ×·¼Ó"D:\tools\java\jdk1.6.0_07\bin;D:\tools\java\jre1.6.0_07\bin";
¡¡¡¡3). CLASSPATH = D:\tools\java\jdk1.6.0_07\lib;D:\tools\java\jdk1.6.0_07\lib\too ......
JAVA×ÛºÏÃæÊÔÌ⣺ҳÃæµÄץȡ¡¢½âÎö¡¢±£´æÊý¾Ý¿âºÍÉú³ÉHTMLµÄÒ³Ãæչʾ ÊÕ²Ø
´ÎÀý×Ó¿ÉÒÔÓÃÀ´Ñ§Ï°ÍøÂç±à³Ì£¬ÕýÔò±í´ïʽµÄʹÓ㬷ºÐÍ£¬Êý¾Ý¿âµÄ»ù±¾²Ù×÷µÈJAVA֪ʶ
ÎÊÌâÈçÏ£ºÀ´Ô´ÓÚÂÛ̳
http://topic.csdn.net/u/20090616/13/59aa4e2d-3752-45df-9c1b-c65c46c3e4d7.html
дһ¸öjspÒ³Ã棬·ÃÎÊʱÏÔʾ´ÓÏÂÃæµÄÒ³ÃæÌ ......
<SCRIPT LANGUAGE="JavaScript">
var tt = "";
var flag = false;
var radios = document.getElementsByName("t1");//´ÓjspÖÐÈ¡radioµÄid»òradioµÄname
for(var i=0;i<radios.length;i++){
//Èç¹ûµ±Ç°ÓÐÑ¡ÖÐ
  ......
jsp JFreeChartʹÓÃÐĵÃÓëÀý×Ó
2009-07-01 10:27
Ò»¡¢JFreeChartµÄ½éÉÜÓë»ñÈ¡ JFreeChart¿ª·¢°üÊÇÒ»¸ö¿ªÔ´µÄJavaͼÐοª·¢°ü,Ëü´ÓÖùÐÎͼ£¬±ýÐÎͼ£¬µ½À×´ïͼ£¬À¯ÖòͼµÈµÈÎÞËù²»°ü,¿ÉÒÔÔÚc/s,b/s,ÉõÖÁÊÇʵʱ»·¾³¶¼ÄÜÒ»ÏÔÉíÊÖ¡£
µ±Ç°µÄJFreeChartµÄ×îа汾Ϊjfreechart-1.0.11.zip¡£¿ÉÒÔµ½http://www.jfree.org/jfreechart/ ......