JSPÓï·¨µÄxml±í´ï
´ó¼Ò×ÜÊDz»Ï²»¶¿´µ½<%ºÍ%>ÔÚjspÒ³ÃæÉÏ£¬ÆäʵÎÒÃÇ¿ÉÒÔʹÓñȽÏÓÅÑŵÄxml·½Ê½À´±í´ï
1£¬Òþº¬µÄ×¢ÊÍ
JSPÓï·¨£º<%-- ÄÚÈÝ --%>
XMLÓï·¨£ºÎÞ
2£¬±äÁ¿»òº¯ÊýµÄÉùÃ÷
JSPÓï·¨:<%! declaration;[declaration;]+... %>
ÀýÈ磺
<%!
int i=0;int a,b,c;
Color red=new Color(255,0,0);
private static final String OK="ok";
public String getAnswer(){
return OK;
}
%>
XMLÓï·¨£º
<jsp:declaration>
declartion;[declaration;]+...
</jsp:declaration>
ÀýÈ磺
<jsp:declaration>
int i=0;int a,b,c;
Color red=new Color(255,0,0);
private static final String OK="ok";
public String getAnswer(){
return OK;
}
</jsp:declaration>
3£¬±í´ïʽ
JSPÓï·¨£º<%=expression%>
ÀýÈ磺
<%=Math.round(Math.random*100)%>
XMLÓï·¨£º
<jsp:expression>
expression
</jsp:expression>
ÀýÈ磺
<jsp:expression>
Math.round(Math.random*100)
</jsp:expression>
4£¬´úÂëÆ¬¶Ï
JSPÓï·¨£º<% your java code %>
ÀýÈ磺
<%
String username=request.getParameter("username").trim();
String password=request.getParameter("password").trim();
%>
XMlÓï·¨£º
<jsp:scriptlet>
your java code
</jsp:scriptlet>
ÀýÈ磺
<jsp:scriptlet>
String username=request.getParameter("username").trim();
String password=request.getParameter("password").trim();
</jsp:scriptlet>
5£¬Ö¸Áinclude
JSPÓï·¨£º<%@include file="relativeURL"%>
ÀýÈ磺<%@include file="static_head.html"%>
XMLÓï·¨£º<jsp:directive.include file="relativeURL"/>
ÀýÈ磺<jsp:directive.include file="static_head.html"/>
6£¬Ö¸Ápage
JSPÓï·¨£º<%@page attribtes%>
ÀýÈ磺<%@page import="java.util.HashMap"%>
XMLÓï·¨£
Ïà¹ØÎĵµ£º
Ëæ×ż¼ÊõµÄÈÕÐÂÔÂÒì £¬JSPµÄм¼ÊõÒ²²ã³ö²»ÇΪÁË·½Ãæ´ó¼ÒµÄѧϰÓ빤×÷£¬ÏÂÃæ½«¼òµ¥µÄ½éÉÜÒ»ÏÂJSP¼Ü¹¹¡¢JSP¿ª·¢¹¤¾ß¡¢Web·þÎñÆ÷¼°Æäîñȱµã¡£
JSP¼Ü¹¹£º
struts£º Struts¸úTomcat¡¢TurbineµÈÖî¶àApacheÏîĿһÑù£¬ÊÇ¿ªÔ´Èí¼þ£¬ÕâÊÇËüµÄÒ»´óÓŵ㣬ʹ¿ª·¢ÕßÄܸüÉ ......
Ò»¡¢
ÎÊ£ºorg.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "192.168.254.103", user "postgres",database "postgres", SSL off
´ð£ºPostgreSQÊý¾Ý¿âΪÁ˰²È«£¬Ëü²»»á¼àÌý³ý±¾µØÒÔÍâµÄËùÓÐÁ¬½ÓÇëÇ󣬵±Óû§Í¨¹ýJDBC·ÃÎÊÊÇ£¬¾Í»á±¨Ò»Ð©ÒÔÉϵÄÒì³£¡£Òª½â¾öÕâ¸öÎÊÌâ ......
Ò»¡¢
ÔÚÒ»¸öÉè¼ÆÁ¼ºÃµÄWebÓ¦ÓÃÖУ¬¶¼»á×ÛºÏʹÓÃServletºÍJSP¼¼Êõ¡£Servlet¿ØÖÆÒµÎñÁ÷ת£¬JSPÔò¸ºÔðÒµÎñ´¦Àí½á¹ûµÄÏÔʾ¡£´Ëʱ£¬½«´óÁ¿Óõ½Öض¨Ïò¼¼Êõ¡£
¡¡¡¡Öض¨Ïò¼¼Êõ¿ÉÒÔ·ÖΪÁ½À࣬һÀàÊǿͻ§¶ËÖØ¶¨Ïò£¬Ò»ÀàÊ ......
JSP¹²ÓÐÒÔÏÂ6ÖÖ»ù±¾¶¯×÷£º
1.jsp:include£ºÔÚÒ³Ãæ±»ÇëÇóµÄʱºòÒýÈëÒ»¸öÎļþ¡£
2.jsp:useBean£ºÑ°ÕÒ»òÕßʵÀý»¯Ò»¸öJavaBean¡£
3.jsp:setProperty£ºÉèÖÃJavaBeanµÄÊôÐÔ¡£
4.jsp:getProperty£ºÊä³öij¸öJavaBeanµÄÊôÐÔ¡£
5.jsp:forward£º°ÑÇëÇóתµ½ ......
struts-config:
<action path="/articleManage" name="articleManageForm" scope="request" type="auction.action.ArticleManageAction" validate="false">
<forward name="atriclesList" path="/WEB-INF/publish/articleManage/atriclesList.jsp"/>
<forward ......