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():´Ó¹«¹²ÇøÓòÀïÈ¡
Ïà¹ØÎĵµ£º
JAVA×ÛºÏÃæÊÔÌâ£ºÒ³ÃæµÄץȡ¡¢½âÎö¡¢±£´æÊý¾Ý¿âºÍÉú³ÉHTMLµÄÒ³ÃæÕ¹Ê¾ ÊÕ²Ø
´ÎÀý×Ó¿ÉÒÔÓÃÀ´Ñ§Ï°ÍøÂç±à³Ì£¬ÕýÔò±í´ïʽµÄʹÓ㬷ºÐÍ£¬Êý¾Ý¿âµÄ»ù±¾²Ù×÷µÈJAVA֪ʶ
ÎÊÌâÈçÏ£ºÀ´Ô´ÓÚÂÛ̳
http://topic.csdn.net/u/20090616/13/59aa4e2d-3752-45df-9c1b-c65c46c3e4d7.html
дһ¸öjspÒ³Ãæ£¬·ÃÎÊʱÏÔʾ´ÓÏÂÃæµÄÒ³ÃæÌ ......
JspÁ¬½ÓMSSQL2000µÄÁ½ÖÖ·½·¨
×î½üÔÚѧϰJSPWeb£¨Tomcat·þÎñÆ÷£©Ó¦Óÿª·¢ºÍ»ùÓÚWeblogicºÍMyelcipseµÄJEE5µÄ¿ª·¢£¬ÔÚѧϰ¹ý³ÌÖÐÉæ¼°µ½Á¬½ÓSQL 2000 Êý¾Ý¿âʱ£¬ÓÉÓÚÈí¼þ»·¾³µÄ²îÒìÐÔºÍһЩ°æ±¾ÎÊÌ⣬»¨Á˺ô󹦷ò²ÅÁ¬ÉÏ£¬ËùÒÔÔÚ´Ë×÷¸ö×ܽᣬϣÍûÄܸø´ó¼ÒһЩ°ïÖú£¬²»ÒªÔÚ»ù±¾µÄ¶«Î÷ÉÏ»¨·ÑÌ«¶àµÄʱ¼ä¡£
·½·¨Ò»£ºÀûÓÃSQL Se ......
´ËÖÖ·½·¨Ê¹ÓÃexcelµÄ×é¼þ£¬ÒªÇó¿Í»§¶Ë±ØÐë×°ÓÐexcel³ÌÐò¡£·½·¨Êǽ«±í¸ñÖеÄÿ¸ötd±êÇ©µÄÄÚÈÝÈ¡³ö£¬×÷ΪexcelÎļþÖÐÒ»¸öµ¥Ôª¸ñµÄÄÚÈÝ¡£
1¡¢ÔÚÍøÒ³ÖÐÌí¼Ójava½Å±¾
function AutomateExcel(tableid,unusecolumn)
{
// »ñÈ¡excel×é¼þ
var oXL = new ActiveXObject("Excel.Application");
// ......
½øÈëMyEclipse6.XÏÂ
Ð޸ģºeclipse.ini Îļþ
-Duser.language=en
¸Ä³É
-Duser.language=zh
µ¯³öÌáʾ£ºCtrl+"/"
dtd ÃüÃû¿Õ¼äµÄÌáʾÐÅÏ¢
window-->Preference-->xml-->XML Catalog-->add
Location :sql-map-2.dtd
key type :pubic ID
key:-//ibatis.apache.org//DTD SQL Map 2.0//EN (XMLÎļþÃüÃû¿Õ¼ ......
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/ ......