½â¾önetbeansдjsp³öÏÖÖÐÎÄÂÒÂëµÄÎÊÌâ
jsp±íµ¥Ìá½»µÄÊý¾ÝÓÐÖÐÎÄʱ³öÏÖÂÒÂ룬²¢·Ç¶ÁÈ¡Êý¾Ý¿âÊý¾ÝºóÏÔʾÂÒÂ룬ÒÔÏÂÊǽâ¾öµÄ·½·¨¡£
netbeans´´½¨jspµÄÄ£°æÖÐÊÇ£º<%@page contentType="text/html" pageEncoding="UTF-8"%>£¬½«ÕâÐиijÉÒÔÏÂÕâÑù¾Í¿ÉÒÔÕý³£ÏÔʾÖÐÎÄ£º
<%@page language="java" pageEncoding=utf-8" %>
<%@page contentType=”text/html;charset=utf-8” %>
ÏÂÃæÊÇÔÚÍøÉÏÕªµÄ¹ØÓÚÒ³Ãæ±àÂë²»Ò»Ö¶ø²úÉúÂÒÂë
´úÂë
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=iso8859-1"%>
<html>
<head>
<title>ÖÐÎÄÎÊÌâ</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
</head>
<body>
ÎÒÊǸöºÃÈË
</body>
</html>
Èý¸öµØ·½µÄ±àÂë¡£
µÚÒ»¸öµØ·½µÄ±àÂë¸ñʽΪjspÎļþµÄ´æ´¢¸ñʽ¡£Ecljpse»á¸ù¾ÝÕâ¸ö±àÂë¸ñʽ±£´æÎļþ¡£²¢±àÒëjspÎļþ£¬°üÀ¨ÀïÃæµÄºº×Ö¡£
µÚ¶þ´¦±àÂëΪ½âÂë¸ñʽ¡£ÒòΪ´æΪUTF-8µÄÎļþ±»½âÂëΪiso8859-1£¬ÕâÑùÈçÓÐÖÐÎĿ϶¨³öÂÒÂë¡£Ò²¾ÍÊDZØÐëÒ»Ö¡£¶øµÚ¶þ´¦ËùÔÚµÄÕâÒ»ÐУ¬¿ÉÒÔûÓС£È±Ê¡Ò²ÊÇʹÓÃiso8859-1µÄ±àÂë¸ñʽ¡£ËùÒÔÈç¹ûûÓÐÕâÒ»ÐеĻ°£¬“ÎÒÊǸöºÃÈ˔Ҳ»á³öÏÖÂÒÂë¡£±ØÐëÒ»Ö²ſÉÒÔ¡£
µÚÈý´¦±àÂëΪ¿ØÖÆä¯ÀÀÆ÷µÄ½âÂ뷽ʽ¡£Èç¹ûÇ°ÃæµÄ½âÂ붼һÖ²¢ÇÒÎÞÎóµÄ»°£¬Õâ¸ö±àÂë¸ñʽûÓйØϵ¡£ÓеÄÍøÒ³³öÏÖÂÒÂ룬¾ÍÊÇÒòΪä¯ÀÀÆ÷²»ÄÜÈ·¶¨Ê¹ÓÃÄÄÖÖ±àÂë¸ñʽ¡£ÒòΪҳÃæÓÐʱºò»áǶÈëÒ³Ã棬µ¼ÖÂä¯ÀÀÆ÷»ìÏýÁ˱àÂë¸ñʽ¡£³öÏÖÁËÂÒÂë¡£
ÔÚJSPÖУº
jsp ´úÂë
<%@page contentType="text/html" pageEncoding="UTF-8"%>
ÔÚServletÖУº
java ´úÂë
response.setContentType("text/html;charset=UTF-8");
ÔÚËùÓеÄÍøÒ³ÖУº
html´úÂë
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
NetbeansͳһUTF-8±àÂëµÄ·½·¨
1.ÕÒµ½ÄãµÄNetbeans°²×°Ä¿Â¼ÏµÄetcÎļþ¼Ð,ÈçC:\Program Files\NetBeans 6.0 M9\etc
2.ÓüÇʱ¾´ò¿ªnetbeans.conf
3.ÕÒµ½netbeans_default_optionsÕâÒ»¾ä(û´ø#ºÅµÄ,´ø#ºÅµÄÊÇ×¢ÊÍ)
4.ÔÚ
Ïà¹ØÎĵµ£º
JSP²ÊÉ«ÑéÖ¤Âë
Éú³ÉÓÐ4¸öËæ»úÊý×ÖºÍÔÓÂÒ±³¾°µÄͼƬ£¬Êý×ֺͱ³¾°ÑÕÉ«»á¸Ä±ä£¬·þÎñÆ÷¶ËˢУ¨ÓÃhistory.go(-1)Ò²»á±ä£©
ÔÐͲο¼ALIBABA http://china.alibaba.com/member/showimage
²úÉúÑéÖ¤ÂëͼƬµÄÎļþ-----image.jsp
<%@ page contentType="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,java ......
ÏÈÌù¸ö½éÉÜ
http://i.cn.yahoo.com/suzie0228/blog/p_41/
proxoolÊÇÒ»¸ö¿ªÔ´µÄÁ¬½Ó³Ø£¬ÐÔÄÜÓÅÒ죬×îºÃµÄÊÇ£º¼´Ê±¼à¿ØÁ¬½Ó³Ø״̬
ÏÂÃæ¼òµ¥ËµËµËüµÄʹÓ÷½·¨£º1¡¢Ê×ÏÈÏÂÔØproxool µØÖ·£ºhttp://proxool.sourceforge.net
2¡¢½âѹËõproxool-0.9.0RC3.zip£¬¿½±´libϵÄËùÓÐjar¿âÎļþµ½ÄãµÄ¹¤³ÌϵÄWEB-INF/libÏ£¬Í¬Ê±¼ÇµÃÒ² ......
JSPÖеÄÌøת£º
(1). forward()·½·¨
ʹÓõ½javax.servlet.RequestDispatcherÀà
RequestDispatcher rd = getServletContext().getRequestDispatcher("url");
rd.forward(requestVar,requestVar); //´«µÝservletµÄÈë¿Ú²ÎÊý
/*forwardº ......
ʹÓÃJSP´óÔ¼ÓÐÏÂÁÐÈýÖÖÌøת·½Ê½£º
1. response.sendRedirect();
2. response.setHeader("Location","");
3. £¼jsp:forward page="" /£¾
¾¹ýÊÔÑéµÃµ½ÏÂÃæµÄһЩ¹æÔò£º
Ò». response.sendRedirect()
´ËÓï¾äÇ°²»ÔÊÐíÓÐout.flush()£¬Èç¹ûÓÐout.flush()£¬»áÓÐÒì³££º
java.lang.IllegalStateException: Can't send ......