JSP STRUTS ECLIPSE ±àÂëÎÊÌâ
jspµÄpageEncoding="UTF-8",strutsµÄencoding="UTF-8"£¬eclipse µÄ¹¤×÷Çø¼äµÄ±àÂ뷽ʽÊÇGBK£¬µ«ÊÇÔÚstrutsµÄactionÖлñµÃµÄjsp´«À´µÄÖÐÎÄÖÐÓÐÂÒÂ룬ʹÓÃnew String(sysgkForm.getContent().getBytes("UTF-8"),"GBK")תÂëÒ²²»ÐУ¬×îºó·¢ÏÖÎÊÌâ³öÔÚÁËjspÀïÃæ¡£¼ÓÉÏcontentType="text/html; charset=GBK" ¾ÍºÃÁË¡£
pageEncoding ºÍ contentType="charset="µÄÇø±ð£º
pageEncodingÊÇjspÎļþ±¾ÉíµÄ±àÂë
contentTypeµÄcharsetÊÇÖ¸·þÎñÆ÷·¢Ë͸ø¿Í»§¶ËʱµÄÄÚÈݱàÂë
Ïà¹ØÎĵµ£º
ѧϰJSPÖ÷ҪѧϰËûµÄ9´ó¶ÔÏó(request, response, pageContext, session, application, out, config, page, exception ),ÕâЩ¶ÔÏó¶¼ÊǾ²Ì¬¶ÔÏ󣬲»Óö¨Òå¾Í¿ÉÒÔÖ±½ÓʹÓ㬰ÑËûÃǶ¼Á˽âÇå³þ²¢»áÔËÓ㬾ͿÉÒÔÔÚ¼òÀúÉÏÌíÉÏÒ»¸öÊìϤ¼¼ÄÜ:JSP
JspÄÚÖöÔÏó ¹¦ÄÜ Ö÷Òª·½·¨
out Ïò¿Í»§¶ËÊä³öÊý¾Ý print() println() flush() ......
Jsp±àÂë¹æ·¶
1.1 Îļþºó׺(File Suffixes)
ÎļþÀà±ð ¡¡¡¡ ¡¡¡¡¡¡¡¡¡¡Îļþºó׺
--------------------------------------
JavaÔ´Îļþ¡¡¡¡¡¡¡¡¡¡¡¡¡¡.java
Java×Ö½ÚÂëÎļþ¡¡¡¡¡¡¡¡¡¡.class
¶¯Ì¬Ò³Ãæ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡.jsp
¾²Ì¬Ò³Ãæ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡.html
½Å±¾Îļþ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡.js
1.2 ³£ÓÃÎļþÃû(Common ......
jspÖеÚÒ»¾ä£º
<%@ page language="java" import="java.sql.*,java.util.*," contentType="text/HTML;charset=gb2312" pageEncoding="gb2312"%>
htmlÖмÓÉÏ
<meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
ͨ³£ÕâÑù¾ÍûÓÐÎÊÌâÁË¡£ .
ÔÙÕߣº µ¼ÈëjsʱºòÉ ......
JSPÁôÑÔ¹ÜÀíϵͳ (¸½¼ÓÓû§È¨ÏÞ¹¦ÄÜ)
1.ÓοͿÉÒԲ鿴ͨ¹ýÉóºËµÄÁôÑÔ£»
2.ÆÕͨÓû§µÇ¼ºó¿ÉÒÔ·¢±íÁôÑÔ£¬ÐÞ¸ÄÃÜÂ룻
3.¹ÜÀíÔ±µÇ¼ºó¿ÉÒÔÉóºË¡¢Ð޸ġ¢É¾³ýÁôÑÔ£»
4.³¬¼¶¹ÜÀíÔ±µÇ¼ºó¿ÉÒÔ¹ÜÀíÓû§£¬É¾³ýÓû§¡¢ÐÞ¸ÄÃÜÂë¡¢¸ü¸ÄȨÏÞ¡£
´ËÁôÑÔ¹ÜÀíϵͳ°üº¬ÒÔÏÂÎļþ£º
1.Ê×Ò³(index.jsp)£º°´·¢±íʱ¼äµ¹ÐòÏÔʾÁôÑÔÄÚÈÝ£¬²»Í¬È¨ ......