Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

·ÃÎÊJSPÎļþ»òÕßServletÎļþʱÌáʾ¡°ÏÂÔØ¡±

ÔÚ·ÃÎÊJSPÎļþ»òÕßServletµÄʱºò£¬Èç¹ûÌáʾÏÂÔز¢±£´æ£¬ÈçÏÂͼËùʾ£º
ͬÑùµÄ³ÌÐòÓеÄä¯ÀÀÆ÷³ö´í£¬ÓеÄä¯ÀÀÆ÷²»³ö´í¡£´íÎóµÄÔ­ÒòÊÇÉèÖÃMIMEÀàÐ͵ĴúÂëÓÐÎó¡£
Èç¹ûÊÇJSPÎļþ£¬²é¿´ÎļþÍ·£º
<%@ page contentType="text/html;charset=gb2312"%>
Èç¹ûÊÇServletÎļþ£¬²é¿´£º
response.setContentType("text/html;charset=gb2312");


Ïà¹ØÎĵµ£º

jsp×Ô¶¨Òå±êÇ©¿ª·¢

²»´¦ÀíÌåÄÚÈݵıêÇ©Àí½âÒ»ÏÂͼƬ1
´¦ÀíÌåÄÚÈݱêÇ©Àí½âÌáͼƬ2
1£ºJspWriter out = pageContext.getOut();
2£ºBodyContent bc = this.getBodyContent();
 3£ºString input = bc.getString();
 4£ºJspWriter out = bc.getEnclosingWriter();
²»´¦ÀíÌåÄÚÈÝ
µÚÒ»ÐдúÂëΪ²»´¦Àí±êÇ©ÌåÄÚÈÝʱÄõ½ÐèÒªµÄÊä³öµ½Ò³ ......

jsp—MySqlÖÆ×÷B/sµÇ½µÄºÃÀý×Ó Ñ§Ï°±Ê¼Ç

½¨Á¢Ìõ¼þÊ×ÏÈÒ»¶¨ÒªÈ·¶¨×Ô¼ºµÄmysql£¬tomcat,eclipseÁ¬½ÓÊÇÕýÈ·µÄ¡£
index.jspºÜ¼òµ¥£¬¾ÍÒ»¸öÌøת¡£
<%
response.sendRedirect("lg.jsp");
%>
lg.jsp ʵÏֵǼ¿ò¼Ü
<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
<title>
login
</title>
</hea ......

JSPʵÀýÈý¡¢sql·ÖÒ³(1)

index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
& ......

jspÖÐ×Ô¶¨Òå±êÇ©×ܽá(Ò»)_´«Í³±êǩƪ

×Ô¶¨Òå±êÇ©ÊÇÈÿª·¢ÈËÔ±´´½¨¿Í»§»¯µÄ±êÇ©,²¢ÇÒÔÚjspÎļþÖÐʹÓÃÕâЩ±êÇ©,ÕâÑù¿ÉÒÔʹjsp´úÂë¸ü¼ò½à!
 Ê×ÏÈÕâÀïÏȽéÉÜ´Ó¶¨Òå±êÇ©µ½Ê¹ÓñêÇ©µÄ²½Öè:
     1,´´½¨×Ô¶¨Òå±êÇ©´¦ÀíÀà,¼°Ïà¹ØÀà.class ²¢ÇÒ°ÑËûÃǶ¼·ÅÔÚWEB-INF/classesĿ¼ÏÂ
     2,´´½¨TLD±êÇ©¿âÃèÊöÎļþ(.tld)Î ......

ÎÒ¿ª·¢Ò»¸öjspϵͳʱÅöµ½µÄÎÊÌâ

1.No getter method for property name problem(struts)
ÓÐÒ»ÖÖ¿ÉÄÜÊÇBeanûÓÐдÏàÓ¦µÄget·½·¨£¬ÀýÈç±äÁ¿userNameµÄget·½·¨ÊÇgetUserName£»
»¹ÓоÍÊÇÕâ¸öBeanΪ¿Õ£»
2.
MyEclipseµÄ×Ô¶¯Ìí¼ÓstrutsºÍhibernate¹¦Äܲ»ÄÜ·µ»Ø£¬Çë×¢Ò⣡
ËùÒÔÎÒÏÈʹÓÃMyEclipseµ¼ÈëstrutsºÍhibernate£¬È»ºó½«ËüÃǵÄjarµ¼Èëµ½ÁíÍâÒ»¸öн¨µÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ