Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : jsp

struts2¿ò¼ÜÔÚjspÒ³ÃæÎÞ·¨½âÎöEL±í´ïʽµÄÎÊÌâ½â¾ö

ÊÇÔÚstruts2ÏÂÒª½â¾ö¸ÃÎÊÌ⣬ÐèÒªÁ½¸öÌõ¼þ£º
1¡¢È·±£¸ÃÓ¦ÓÃΪJ2EEµÄÓ¦Ó㬼´ÔÚweb.xmlϱ£Ö¤ÓÐÒÔÏÂÅäÖÃÐÅÏ¢£º
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
ÒÔÉÏÅäÖÃÐÅÏ¢Èç¹ûÊÇͨ¹ýMyEclipse½¨Á¢µÄÓ¦Óö¼»áÓеġ£Òò´Ë¹Ø¼üÊÇÏÂÃæÒ»²½£º
2¡¢ÔÚjspÒ³ÃæÉÏÉèÖÃEL±í´ïʽÊôÐÔ£¬Ê¹jspÒ³ÃæÄܹ»½âÎöEL±í´ïʽ£º
<%@page isELIgnored="false" %>
¸ÃÊôÐÔjspÒ³Ãæ¿ÉÄÜÎÞ·¨±æ±ð³öÀ´£¬µ«ÎÞ°­ÓÚjspÒ³ÃæµÄ½âÎö¡£ ......

JSP±¨±í´òÓ¡µÄÒ»ÖÖ¼òµ¥½â¾ö·½°¸

 1. ÔÚWord»òExcelÖÐÖÆ×÷±¨±íµÄÑùʽ¡£
¡¡¡¡ExcelµÄÐиߺÍÁÐ¿íµ¥Î»ÎÞ·¨ÓÃmm»òcm±íʾ¡£
¡¡¡¡ÐèÒª¼ÆËã¡£ÔÚ1024*768Ï£¬1CMԼΪ38ÏñËØ¡£
¡¡¡¡ÒÔ´ËΪ»ù×¼£¬¿É¼ÆËã²¢¿ØÖƱ¨±íµÄÐÐÁÐλÖá£
¡¡¡¡2. ÔÚWordÖÐÉèÖÓ±í¸ñ——±êÌâÐÐÖظ´”¡£
¡¡¡¡ÔÚExcelÖÐÉèÖÓÎļþ——Ò³ÃæÉèÖ×—¹¤×÷±í——´òÓ¡±êÌ┡£
¡¡¡¡3. Áí´æΪÍøÒ³£¬¸Äºó׺Ãû“htm”Ϊ“jsp”¡£
¡¡¡¡4. Word±¨±íÎļþͷΪ£º
£¼%@page contentType="application/msword;charset=GBK" language="java"%£¾
¡¡¡¡Excel±¨±íÎļþͷΪ£º
£¼% @page contentType="application/vnd.ms-excel;charset=GBK" language="java"%£¾
¡¡¡¡5. ÔÚÎļþÍ·²¿·Ö¶¨Òå´òÓ¡²ÎÊý±äÁ¿ÈçÏ£¨ÒÔExcelΪÀý£©£º
£¼%
//ÐèÒª´òÓ¡µÄ¼Ç¼ÌõÊý
int PrintRowCount=RowCount;
//ÿҳ´òÓ¡µÄ¼Ç¼ÌõÊý
int PageRowCount=16;
//×îºóÒ»Ò³ÐèÒª´òÓ¡µÄ¿ÕÐеÄÊýÄ¿
int LoopNum=PageRowCount-PrintRowCount%PageRowCount;
//´òÓ¡ÇøÓòµÄ¸ß¶È£¬ÆäÖÐ2µÄÒâ˼ÊÇÿҳÐèÒªÖظ´µÄ±êÌâÐеÄÊýÄ¿
int PrintAreaHeight=(PrintRowCount%PageRowCount==0)?PrintRowCount+2:Pr ......

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 ......

jsp³£Ê¶£¬²»¶Ï¸üÐÂÖÐ...

CGI¾ÍÊÇweb·þÎñÆ÷¸¨Öú³ÌÐò£¬ºÍservletÊÇÒ»¸ö×÷Óá£
----jspÓÐʲô-----
------------------------------------------------------
jsp¿ÉÒÔ°üÀ¨Ê²Ã´£º
1¡¢jsp½Å±¾£¨³ÌÐòƬ¶Î£©£º
<% ... %>
2¡¢jsp±í´ïʽ£º
<%= ... %>
3¡¢jsp3ÖÖÖ¸Á
<%@ page attribute="xxx" %>
<%@ taglib attribute="xxx"%>
<%@ include attribute="xxx"%>

4¡¢jspÄ£°åÎı¾£¨»ù±¾html£©£ºÔÚJSPÀ±ê×¼µÄhtml³ÉΪģ°åÎı¾¡£
5¡¢jspÉùÃ÷£º
6¡¢jspÒþʽ¶ÔÏó£º
ps:ĬÈÏÇé¿öÏÂjspÎļþÖеÄÄ£°åÎı¾ÎªhtmlÎı¾£¬Èç¹ûͨ¹ý<%@ page contentType="text/plain" %>Óï¾ä°ÑÏìÓ¦ÕýÎÄÀàÐÍÉèΪ"text/plain",ÄÇôjspÎı¾ÖеÄÄ£°åÎı¾Îª´¿Îı¾¡£
ÕâÑùÒ»À´jsp»á°ÑhtmlÔ´Âë·¢Ë͵½¿Í»§¶Ë¡£ÓÃopera·ÃÎʵõ½ÊÇÔ´Â룬ÓÃieû±ä»¯....
-------------------------------------------------------
---serlvet jspÊÇʲô£¿-------
-------------------------------------------------------
servletºÍjsp¶¼ÊÇʹÓÃioÁ÷½«html´úÂë·¢Ë͵½¿Í»§¶Ë¡£
ÔÚservletÀïÒ»ÇкÜÃ÷ÏÔ¡£¶øjspÒ²²»¹ýÊÇÈÃÈÝÆ÷À´¶ÁÈ¡jsp£¬½«Ìض¨µÄ±ê¼Ç(jspÀïµÄ±ê¼Ç)½øÐнâÎö´¦Àí(Èç¹ûÊÇhtmlÎı¾Ö±½Ó¶Á ......

jspºÍservletµÄÇø±ð

  ÔªÎÊÌâÀ´×ÔJSPÓëServletµÄ±È½Ï¡£
      ÎÒÃÇÖªµÀServletÄܹ»Ê¹µÃJAVA´úÂë²»ÓÃÏñAppletÄÇÑùÔÚ¿Í»§ä¯ÀÀÆ÷ÖÐÔËÐУ¬Ëü»áÔÚÄã¿ØÖƵÄÒ»¸öÓ¦Ó÷þÎñÆ÷ÉÏÔËÐС£ÔÚûÓÐʲô±³¾°ÖªÊ¶µÄÇ°ÌáÏÂÎÒĬÈÏÕâÊÇÒ»ÖÖ¹æÔò£¬¼´Servlet¾ÍÊÇÕâÑù·¢Õ¹ÆðÀ´µÄ¡£ÔÚʵ¼ÊÓ¦ÓÃÖе±ÎÒÃÇÇëÇóÒ»¸öJSPÒ³ÃæµÄʱºò£¬JSPÊ×Ïȱ»×ª»¯ÎªServlet£¬È»ºóÔÙ½øÐбàÒë,Ö´ÐУ¬×îºó½«½á¹û·µ»Ø¸øä¯ÀÀÆ÷¡£
ÎÊÌâÒ»: ÄÇô¼ÈÈ»ÊÇÕâÑù£¬Ò²¾ÍÊÇ˵ÏÈÓÐJSPºóÓÐServlet£¬ÄÇôΪºÎÒª°ÑËüÃÇÄõ½Ò»Ð©À´½øÐбȽÏÄØ£¿ÊÇÎÒÕâÖÖ"ÏÈÓÐJSPºóÓÐServlet"µÄÈÏΪÓдíÂð?
×Ô¼ºÕâÑùÈÏΪ£º
²»Ò»¶¨ÊÇÏÈÓÐJSPºó²ÅÓÐServletµÄ£¬ÒòΪͬÊÇÒ»ÖÖÓïÑÔ£¬JSPÖ»ÊÇÔÚHTMLÖГ·â×°”ÁËJAVA ÓïÑÔ£¬JSP ±êÇ©¡£¶øServlet ÊÇÔÚJAVA ÖГ·â×°”ÁËJSP±êÇ©£¬HTML±êÇ©¡£Òò´ËËüÃÇÊÇƽµÈµÄ¡£ÎÒÃÇ¿ÉÒÔÖ±½Ó±àдServlet£¬µ±È»ÎÒÃÇÒ²¿ÉÒÔÖ±½Ó±àдJSPÂÞ¡£
ÎÊÌâ¶þ:ΪʲôҪ°ÑJSPÏȽ»¸ø·þÎñÆ÷½øÐд¦Àí?
×Ô¼ºÕâÑùÈÏΪ£º
1.ÒòΪJSPÊÇÒ»ÖÖ·þÎñÆ÷¶ËǶÈëÁËJAVA´úÂëµÄ½Å±¾ÓïÑÔÒòΪJAVA´úÂëÊDz»ÄÜûÓÐJVMµÄÌõ¼þϱàÒ룬ִÐУ¬ÔÙÔËÐеġ£ËùÒÔÒª½«´¦ÀíJAVA´úÂëµÄÕâÒ»²½½»¸øÄܹ»´¦ÀíJAVA´úÂëµÄ·þÎñÆ÷À´½øÐд¦Àí¡£
2.ÒòΪJSPÒ³ÃæÖаüº¬Ó ......

ʯ¼ÒׯÍøÕ¾Éè¼Æ£ºjspÍøÕ¾µÄ¾²Ì¬Ò³ÃæÉú³É·½°¸

ʯ¼ÒׯÌáÉýÍøÕ¾ÐÔÄܵķ½Ê½Óкܶ࣬ÀýÈçÓÐЧµÄʹÓûº´æ£¬Éú³É¾²Ì¬Ò³ÃæµÈµÈ¡£½ñÌìҪ˵µÄ¾Í
ÊÇÉú³É¾²Ì¬Ò³ÃæµÄ·½Ê½¡£
ʲô½ÐÉú³É¾²Ì¬Ò³ÃæÄØ£¿ºÜ¼òµ¥£¬ÀýÈçÎÒÃÇÈç¹û·ÃÎÊÒ»¸öÁ´½Ó http://xyz.com/index.do£¬
ÄÇô·þÎñÆ÷¾Í»á½âÎöÕâ¸öÇëÇó£¬ÈÃÌض¨µÄAction È¥´¦Àí¡£ÕâÆäÖеÄȱµãÊÇÏÔ¶øÒ×¼ûµÄ£ºÈç¹û
·ÃÎʵÄÈË£¬ÄÇô¾Í»á¼ÓÖØÓ¦Ó÷þÎñÆ÷µÄѹÁ¦£¬×î¶ñÁӵĺó¹û¾ÍÊÇÓ¦Ó÷þÎñÆ÷down µôÁË¡£ÄÇ
ôÈçºÎÈ¥±ÜÃâÄØ£¿Èç¹ûÎÒÃÇ°Ñ¶Ô index.do ÇëÇóºóµÄ½á¹û±£´æ³ÉÒ»¸ö html Îļþ£¬È»ºóÿ´Î
Óû§¶¼È¥·ÃÎÊ http://xyz.com/index.html £¬ÕâÑùÓ¦Ó÷þÎñÆ÷µÄѹÁ¦²»¾Í¼õÉÙÁË£¿
ºÃ°É£¬ÎÒÒѾ­Ñ§»áÈçºÎÉú³É¾²Ì¬Ò³ÃæÁË¡£´ò¿ªÎÒµÄä¯ÀÀÆ÷£¬ÊäÈë http://xyz.com/index.do£¬
È»ºóÔÙʹÓÓÁí´æΪ”¹¦Äܱ£´æÒ»¸öhtml Îļþ£¬È»ºóÉÏ´«µ½·þÎñÆ÷£¬ÕâÑù¾Íok ÁË£¡
ÎÒ²»ÄÜ˵Õâ²»Êǽâ¾ö·½°¸£¬µ«ÊÇÎÒ¿ÉÒÔ˵Õâ²»ÊǺõĽâ¾ö·½°¸¡£ÎÒÃÇÐèÒªµÄÊÇ×Ô¶¯µÄÉú
³É¾²Ì¬Ò³Ã棬µ±Óû§·ÃÎÊ http://xyz.com/index.do£¬»á×Ô¶¯Éú³É index.html £¬È»ºóÏÔʾ¸ø
Óû§¡£
1¡¢ »ù´¡—URL Rewrite
ʲôÊÇ URL Rewrite ÄØ£¿Çë google it ☺ ¡£²»¹ýÕâÀï¼òµ¥µÄ啰àÂһϡ£´Ó×ÖÃæ
ÉÏÎÒÃǾͿÉÒÔÀí½âËüµÄÒâ˼£ºURL ÖØд¡£Ó ......
×ܼǼÊý:884; ×ÜÒ³Êý:148; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [139] [140] [141] [142] [143] 144 [145] [146] [147] [148]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ