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
Ïà¹ØÎĵµ£º
Servlet ÕûÌå¼ÓÔعý³ÌÈçÏÂ
1¡¢Web·þÎñÆ÷½ÓÊÜrequest¡£
2¡¢ÇëÇ󷢸øServletÒýÇ棬Èç¹ûÒѾ¼ÓÔØservlet£¬class ÔòÖ±½ÓÖ´ÐУ¬·ñÔò´ÓÓ²ÅÌÖвéÕÒclass ¼ÓÔؽøÀ´¡£
3¡¢Ö´ÐÐService·½·¨´¦ÀíÇëÇ󣬲¢·µ»Ø¸øweb·þÎñÆ÷¡£
4¡¢web·þÎñÆ÷·µ»Ø¸ø¿Í»§¶Ë¡£
ServletµÄ¼Ì³Ð¹ØϵΪ
Servlet &n ......
ÄãµÄ¿ì½Ý½¨ÉèÖÃÓÐÎÊÌ⣬ÄãÖØÐÂÉèÖÃÒ»ÏÂÔÚ window --> Perferences--> General--> keys
½«Content Assist¿ì½Ý¼üÉèÖóÉAlt + /¾Í¿ÉÒÔÁË
Èç¹ûÄã·¢ÏÖµãÁËApply¹ØÁËÖ®ºó£¬Ôٴδò¿ªContent AssistµÄ¿ì½Ý¼üûÓиıäµÄ»°£¬ÄÇÊÇÒòΪÏÂÃæÓÐÒ»¸öÑ¡ÏîÒѾÓõ½ÁËAlt + /£¬¾ßÌåÊÇÄÄÒ»¸öÎҼDz»ÇåÁË£¬Äã°ÑÄǸöcommandµÄ¿ì½Ý¼ü¸ ......
<%@ page contentType="text/html; charset=gbk" language="java" import="java.io.*" buffer="64kb" %>
<%
String path_in = "";
String content = "";
path_in = request.getRealPath("/")+"admin"+File.separator+ ......
<%@ page contentType="text/html; charset=gbk" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.io.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w ......
<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 ......