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

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ÉÏ´«Îļþµ½Êý¾Ý¿âºÍ´ÓÊý¾Ý¿âÏÂÔØÎļþ

ÓÃÁËcommons-fileupload-1.2.jarºÍcommons-io-1.3.2.jarÕâÁ½¸ö°ü¡£
save.jsp
<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.regex.*"%>
<%@ page import="org.apache.co ......

jsp(JAVA)α¾²Ì¬µÄ¾ßÌåÉèÖùý³Ì

Ç°¼¸Ì죬ºþÄÏSEOÔÚÓÃjspдһ¸öÆóÒµÕ¾³ÌÐòµÄʱºò£¬ÒòΪҪ²Î¼ÓÏîÄ¿´ð±ç¾ºÑ¡£¬ËùÒÔ¾ÍÏëΪ×Ô¼ºÐ´µÄ³ÌÐò¸ã¼¸¸öÁÁµã£¬ÒòΪ¸ãSEO¾ÃÁË£¬²»×Ô¾õ¾Í»áÏ뵽α¾²Ì¬£¬µ«ÊÇÔڰٶȲéÁËÒ»¸öÏÂÎ磬ֻ²éµ½ÁËurlrewrite¼Ü°üµÄÏÂÔصط½£¬ºÍ¼ÜÉè·½ÃæµÄÎÄÕ£¬²¢Ã»ÓÐjsp(JAVA)α¾²Ì¬µÄ¾ßÌå²Ù×÷ʾ·¶£¬ÓеÄÒ²Ö»ÊÇ£¬µ¥Ò³ÃæµÄα¾²Ì¬µÄд·¨£¬ÕâÀïÎÒ¾ÍÖØÍ· ......

js¡¢jsp´«µÝ²ÎÊýÂÒÂëÎÊÌâ½â¾ö

ÒÔÇ°ÓÐÌáµ½¹ýÂÒÂëÎÊÌ⣬×î½üÔÚʹÓÃwindow.openʱÓÖ³öÏÖ´ËÀàÎÊÌ⣬ÏÖ½â¾öÈçÏ£º
1£ºÊ¹ÓÃencodeURIComponentº¯Êý¶Ô²ÎÊý½øÐд¦Àí£¬ÀýÈ磺window.open("html.jsp?name=" + encodeUrlComponent(value)));
2£ºÐÞ¸Ätomcat·þÎñÆ÷µÄserver.xmlÎļþÌí¼Ó£ºuseBodyEncodingForURI="true"»òÕß
URIEncoding=" ......

jspÓÐÄÄЩ¶¯×÷?×÷Ó÷ֱðÊÇʲô?

JSP¹²ÓÐÒÔÏÂ6ÖÖ»ù±¾¶¯×÷£º
   1.jsp:include£ºÔÚÒ³Ãæ±»ÇëÇóµÄʱºòÒýÈëÒ»¸öÎļþ¡£
   2.jsp:useBean£ºÑ°ÕÒ»òÕßʵÀý»¯Ò»¸öJavaBean¡£
   3.jsp:setProperty£ºÉèÖÃJavaBeanµÄÊôÐÔ¡£
   4.jsp:getProperty£ºÊä³öij¸öJavaBeanµÄÊôÐÔ¡£
   5.jsp:forward£º°ÑÇëÇóתµ½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ