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

Jsp·½Ãæ

1¡¢forward ºÍredirectµÄÇø±ð
´ð£ºforwardÊÇ·þÎñÆ÷ÇëÇó×ÊÔ´£¬·þÎñÆ÷Ö±½Ó·ÃÎÊÄ¿±êµØÖ·µÄURL£¬°ÑÄǸöURLµÄÏìÓ¦ÄÚÈݶÁÈ¡¹ýÀ´£¬È»ºó°ÑÕâЩÄÚÈÝÔÙ·¢¸øä¯ÀÀÆ÷£¬ä¯ÀÀÆ÷¸ù±¾²»ÖªµÀ·þÎñÆ÷·¢Ë͵ÄÄÚÈÝÊÇ´ÓÄĶùÀ´µÄ£¬ËùÒÔËüµÄµØÖ·À¸Öл¹ÊÇÔ­À´µÄµØÖ·¡£
    redirect¾ÍÊÇ·þÎñ¶Ë¸ù¾ÝÂß¼­,·¢ËÍÒ»¸ö״̬Âë,¸æËßä¯ÀÀÆ÷ÖØÐÂÈ¥ÇëÇóÄǸöµØÖ·£¬Ò»°ãÀ´Ëµä¯ÀÀÆ÷»áÓøղÅÇëÇóµÄËùÓвÎÊýÖØÐÂÇëÇó£¬ËùÒÔsession,request²ÎÊý¶¼¿ÉÒÔ»ñÈ¡¡£
2¡¢jspÓÐÄÄЩÄÚÖöÔÏó?×÷Ó÷ֱðÊÇʲô?
´ð£ºJSP¹²ÓÐÒÔÏÂ9ÖÖ»ù±¾ÄÚÖÃ×é¼þ£¨¿ÉÓëASPµÄ6ÖÖÄÚ²¿×é¼þÏà¶ÔÓ¦£©£º
¡¡request Óû§¶ËÇëÇ󣬴ËÇëÇó»á°üº¬À´×ÔGET/POSTÇëÇóµÄ²ÎÊý
   response ÍøÒ³´«»ØÓû§¶ËµÄ»ØÓ¦
   pageContext ÍøÒ³µÄÊôÐÔÊÇÔÚÕâÀï¹ÜÀí
   session ÓëÇëÇóÓйصĻỰÆÚ
   application servlet ÕýÔÚÖ´ÐеÄÄÚÈÝ
   out ÓÃÀ´´«ËÍ»ØÓ¦µÄÊä³ö
   config servletµÄ¹¹¼Ü²¿¼þ
   page JSPÍøÒ³±¾Éí
   exception Õë¶Ô´íÎóÍøÒ³£¬Î´²¶×½µÄÀýÍâ
3¡¢jspÓÐÄÄЩ¶¯×÷?×÷Ó÷ֱðÊÇʲô?
´ð:JSP¹²ÓÐÒÔÏÂ6ÖÖ»ù±¾¶¯×÷
   jsp:include£ºÔÚÒ³Ãæ±»ÇëÇóµÄʱºòÒýÈëÒ»¸öÎļþ¡£
   jsp:useBean£ºÑ°ÕÒ»òÕßʵÀý»¯Ò»¸öJavaBean¡£
   jsp:setProperty£ºÉèÖÃJavaBeanµÄÊôÐÔ¡£
   jsp:getProperty£ºÊä³öij¸öJavaBeanµÄÊôÐÔ¡£
   jsp:forward£º°ÑÇëÇóתµ½Ò»¸öеÄÒ³Ãæ¡£
   jsp:plugin£º¸ù¾Ýä¯ÀÀÆ÷ÀàÐÍΪJava²å¼þÉú³ÉOBJECT»òEMBED±ê¼Ç
4¡¢JSPÖж¯Ì¬INCLUDEÓ뾲̬INCLUDEµÄÇø±ð£¿
´ð£º¶¯Ì¬INCLUDEÓÃjsp:include¶¯×÷ʵÏÖ
   <jsp:include page="included.jsp" flush="true" />Ëü×ÜÊÇ»á¼ì²éËùº¬ÎļþÖеı仯£¬ÊʺÏÓÃÓÚ°üº¬¶¯Ì¬Ò³Ã棬²¢ÇÒ¿ÉÒÔ´ø²ÎÊý
   ¾²Ì¬INCLUDEÓÃincludeαÂëʵÏÖ,¶¨²»»á¼ì²éËùº¬ÎļþµÄ±ä»¯£¬ÊÊÓÃÓÚ°üº¬¾²Ì¬Ò³Ãæ
   <%@ include file="included.htm" %>
5¡¢Á½ÖÖÌøת·½Ê½·Ö±ðÊÇʲô?ÓÐʲôÇø±ð?
´ð£ºÓÐÁ½ÖÖ£¬·Ö±ðΪ£º
  <jsp:include page="included.jsp" flush="true">
  <jsp:forward page= "nextpage.jsp"/>
Ç°ÕßÒ³Ãæ²»»áתÏòincludeËùÖ¸µÄÒ³Ã棬ֻÊÇÏÔʾ¸ÃÒ³µÄ½á¹û£¬Ö÷Ò³Ã滹ÊÇÔ­À´µÄÒ³Ãæ¡£Ö´ÐÐÍêºó»¹»á»ØÀ´£¬Ï൱ÓÚº¯Êýµ÷Óᣲ¢ÇÒ¿ÉÒÔ´ø²ÎÊý.ºóÕßÍêȫתÏ


Ïà¹ØÎĵµ£º

JSP/J2EE ÔÚÆÕͨÀàÖлñÈ¡ÏîÄ¿ÔÚtomcatÀïÃæµÄÎïÀí·¾¶

private String projectName="sz_pro";        //  ÄãÏîÄ¿µÄÃû³Æ
//»ñÈ¡µ±Ç°ÏîÄ¿µÄ¾ø¶Ô·¾¶
  public String getPorjectPath(){
   String nowpath;             //µ±Ç°tomcatµÄbi ......

JSP²ÊÉ«ÑéÖ¤Âë

JSP²ÊÉ«ÑéÖ¤Âë
Éú³ÉÓÐ4¸öËæ»úÊý×ÖºÍÔÓÂÒ±³¾°µÄͼƬ£¬Êý×ֺͱ³¾°ÑÕÉ«»á¸Ä±ä£¬·þÎñÆ÷¶ËˢУ¨ÓÃhistory.go(-1)Ò²»á±ä£©
Ô­ÐͲο¼ALIBABA http://china.alibaba.com/member/showimage
²úÉúÑéÖ¤ÂëͼƬµÄÎļþ-----image.jsp
&lt;%@ page contentType="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,java ......

jspÉú³ÉExcel±¨±íµÄ·½·¨

Excel±¨±íµÄ·½·¨£¬Ò»¸ö¹ý춼òµ¥£¬Ò»¸öÖ»ÄÜÓÃì¶windowƽ̨(ÒòΪʹÓÃjdbc-odbc bridge)£¬ÇÒÎÞ·¨Ê¹Óõ½ExcelÄÚ²¿µÄ¸÷ÖÖ¹«Ê½»òÊÇ·½·¨£¬Òò´Ë£¬½ñÌì½éÉÜÒ»¸öapache³öµÄÔª¼þ½ÐPOI£¬Ëü¿ÉÒÔÔÚUNIX»òwindowƽ̨´¦Àíword»òExcelµµ°¸£¬¶ø²»ÐèÒªÒÀ¿¿windowµÄcom£¬²¢ÇÒ¿ÉÉ趨´¢´æ¸ñ¸ñʽ¡¢ÁÐÓ¡¸ñʽµÈµÈ£»½ñÌìÎÒÀ´½éÉÜÆäÖÐÓйØ×ÊÁ϶ÁÈ¡¡¢ÐÂÔ ......

jspµ÷ÓÃjni·½·¨

ÎҵĻ·¾³:
--------
1. java±àÒëÆ÷:eclipse 3.0.2
2. web·þÎñÆ÷: tomcat 4.1.24
3. C±àÒëÆ÷: VC6.0
4. ²Ù×÷ϵͳ: win2k
5. javaÔ´ÎļþĿ¼: d:\study\src
6. java±àÒëºóµÄclassÎļþĿ¼: d:\study\bin
7. tomcatĿ¼: d:\tomcat41
1.±àдjavaÎļþ:
//Util.java
package com.jni;
public class Util
{
 & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ