JspÉú³É¾²Ì¬Ò³Ãæ
ΪÁ˼õÇá·þÎñÆ÷ѹÁ¦£¬½«ÔÀ´µÄÎÄÕ¹ÜÀíϵͳÓÉJSPÎļþµÄ´ÓÊý¾Ý¿âÖÐÈ¡Êý¾ÝÏÔʾ¸ÄΪÓÉjspÉú³É¾²Ì¬htmlÎļþºóÖ±½Ó·ÃÎÊhtmlÎļþ¡£Ê×ÏÈÓ¦´´½¨Ò»¸öÄ£°åÎļþ£¬ÎļþÃûºÍÎļþºó׺¿ÉÒÔËæÒ⣬µ«ÎÒÒ»°ã³£ÓõĻ¹ÊÇ *.template £¬Òò´Ë£¬ÕâÀï¾ÍÒÔ template.template ΪÀý( ½«Ä£°åÎļþ·ÅÈë /WEB-INF/templates/ Îļþ¼ÐÏ )£ºÏÂÃæÊÇÒ»¸ö¼òµ¥µÄʾÀý
1.buildhtml.jsp
Jsp´úÂë
<%@ page contentType="text/html; charset=gb2312" import="java.util.*,java.io.*"%>
<%
try{
//ÉèÖÃ×Ö·û±àÂë
request.setCharacterEncoding( "gb2312" );
response.setCharacterEncoding( "gb2312" );
String title="This is Title";
String content="This is Content Area";
String editer="LaoMao";
String filePath = "";
// »ñµÃÄ£°åÎļþµÄ·¾¶
filePath = request.getRealPath("/")+"test/template.htm";
//out.print(filePath+"<br>");
String templateContent="";
//¶ÁÈ¡Ä£¿éÎļþ
FileInputStream fileinputstream = new FileInputStream(filePath);
int lenght = fileinputstream.available();
byte bytes[] = new byte[lenght];
fileinputstream.read(bytes);
fileinputstream.close();
&nbs
Ïà¹ØÎĵµ£º
1. RequestDispatcher.forward()
ÊÇÔÚ·þÎñÆ÷¶ËÆð×÷ÓÃ,µ±Ê¹ÓÃforward()ʱ,Servlet engine´«µÝHTTPÇëÇó´Óµ±Ç°µÄServlet or JSPµ½ÁíÍâÒ»¸öServlet,JSP »òÆÕͨHTMLÎļþ,Ò²¼´ÄãµÄformÌá½»ÖÁa.jsp,ÔÚa.jspÓõ½ÁËforward()Öض¨ÏòÖÁb.jsp,´ËʱformÌá½»µÄËùÓÐÐÅÏ¢ÔÚ b.jsp¶¼¿ÉÒÔ»ñµÃ,²ÎÊý×Ô¶¯´«µÝ. µ«forward()ÎÞ·¨Öض¨ÏòÖÁÓÐframe ......
JSPÐÂÎÅ·¢²¼ÏµÍ³androidÐж¯Íø
´ËÍøÕ¾µÄÑÝʾµØַΪ:http://www.androidgo.cn
²âÊÔÍøÖ·: http://ja00028.j01.netjsp.com
ÏÂÔصØÖ·::http://download.csdn.net/source/1653791
¼¼ÊõʵÏÖ:²ÉÓÃJSTL±êÇ©,»ùÓÚservlet,jdbc¿ª·¢¡£Ê¹ÓÃmysqlÊý¾Ý¿â¡£
Éè¼ÆÓÅÊÆ:Ò»Çм¼ÊõʹÓÃ×îµ×²ãµÄ£¬Ã»ÓÐʹÓÃssh¿ò¼Ü£¬¿ÉÒÔÔÚÈκιúÄÚµÄjs ......
Á½ÄêÇ°£¬ÔøÓÐһλǰ±²¶ÔÎÒ˵¹ý£º¿ª·¢Ò»¸öÊôÓÚÄã×Ô¼ºµÄÍøÕ¾£¬È»ºóÿÌ컨һµã¿ÕÏеÄʱ¼äÈ¥¾ÓªÒ»Ï£¬ÖÕÓÐÒ»Ì죬Äã»á·¢¾õËüÊǷdz£ÓÐÓõġ£¸Õ¿ªÊ¼µÄʱºò£¬ÎÒûÓаÑÕâЩ»°·ÅÔÚÐÄÉÏ£¬ÂýÂýµØ£¬ÎҲŷ¢¾õÕâλǰ±²ËµµÄ»°ÊǺÜÓеÀÀíµÄ¡£¼ÙÉèÁ½ÄêÇ°¿ªÊ¼¾ÓªÒ»¸öÍøÕ¾£¬Í¨¹ýÕâÁ½ÄêµÄÍƹãºÍÔËÓª£¬Ëµ²»¶¨µ½Ï ......
ÔÚJspºÍjspÖеÄjavabeanÀïÃ棬"/"Ö¸µÄÊÇtomcatËùÔڵĸù·¾¶£¬Èç¹ûÊÇÔÚWindowsϾÍÊÇtomcatËùÔÚÅ̵ÄÅÌ·û£»¶ø“.”Ö¸µÄÊÇtomcatµÄbinĿ¼ËùÔڵķ¾¶¡£
ÎÒ²ÂÏëÕâÊÇÒòΪjsp´úÂ붼»á±»tomcatתΪServlet£¬¶øServletÊÇÔÚtomcatÖзÃÎʵģ¬ËùÒÔjvmÔÚÔËÐÐServletʱ¾ÍÈÏΪĿ¼ÊÇtomcatËùÔÚµÄĿ¼¡£
HtmlÖеē/&r ......
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Author" content="Jiang Hongbin">
<title>ÈÕÆÚÑ¡Ôñ - BY ziyue</title>
<script language="JavaScript" type="text/JavaScript">
// ÈÕÆÚÑ¡Ôñ
var months = new Array ......