EOS6ÖÐÔÚJSPÒ³ÃæÖжÁÈ¡Ò³ÃæÁ÷ÖеÄDataObject¶ÔÏó
EOS6ÖÐÔÚJSPÒ³ÃæÖжÁÈ¡Ò³ÃæÁ÷ÖеÄDataObject¶ÔÏó
´úÂëÈçÏ£º
<%@page pageEncoding="UTF-8" import="java.util.*"%>
<%@page import="com.eos.web.taglib.util.*" %>
<%@page import="commonj.sdo.DataObject,commonj.sdo.Property" %>
<%@include file="/common/common.jsp"%>
<%@include file="/common/skins/skin0/component.jsp" %>
<html>
<!--
- Author(s): lijd
- Date: 2009-04-28 17:47:57
- Description:
-->
<head>
<title>Title</title>
</head>
<body>
<%
Object root= com.eos.web.taglib.util.XpathUtil.getDataContextRoot("request", pageContext);
DataObject[] objs=(DataObject[])XpathUtil.getObjectByXpath(root,"outObjs");// "outObjs" ΪҳÃæÁ÷ÉϵÄXpath£¨DataObjectÊý×飩
int len = objs.length;
String outStr = "Length:"+len+"CONTENT:";
for (int i =0;i<len;i++){
List list=objs[i].getInstanceProperties();
Iterator it=list.listIterator();
while(it.hasNext()){
Property pro=(Property)it.next();
outStr=outStr+pro.getName()+"-"+objs[i].get(pro)+",";
}
outStr=outStr+"|";
}
System.out.println(outStr);
%>
</body>
</html>
Ïà¹ØÎĵµ£º
response.sendRedirect("display.jsp");
request.getRequestDispatcher("display.jsp").forward(request,response);
jspµÄÒ³ÃæÌøתÓÐÁ½ÖÖ·½·¨£ºRequestDispatcher.forward()·½·¨ºÍHttpServletResponse.sendRedirect()·½·¨¡£
¡¡¡¡ËüÃǵÄÇø±ðÊÇ£º
¡¡¡¡RequestDispatcher.forward()·½·¨½öÊÇÈÝÆ÷ÖпØÖÆȨµÄתÏò£¬ÔÚ¿Í»§¶Ëä ......
ÔÚÍøÉÏ¿´µ½ºÜ¶àÎÊÌâÊǹØÓÚÈçºÎѧϰjspµÄ£¬ÕýºÃÍøÉÏ¿´µ½Ò»Æª¹ØÓÚѧϰjspµÄÎÄÕ£¬¾ÍÕªÁËÒ»²¿·Ö·Òë¹ýÀ´£¬Ï£ÍûÄܶԴó¼ÒѧϰjspÓеãÖ¸µ¼¡£
¡¡¡¡Ò»¸öÆÕͨµÄ´íÎóÊÇ°ÑJSPµ±×÷¼ò»¯µÄ Java¡£Ëü²»ÊÇ£¬£¨ÊÂʵÉÏ, JSP ÊǼò»¯µÄ servlets ¡££©³ÌÐòԱͨ³£ÊÔ×ÅûÓÐѧϰҪÇóµÄÖ§³Ö¼¼ÇɶøÖ±½Óѧϰ JSP ¡£JSP ÊÇÒ»¸öÏνӼ¼Êõ£¬²¢Çҳɹ¦µØÁ¬½ ......
1.Ìí¼Ó host ¿é
ÿһ¸öJSPÐéÄâÖ÷»úÓÐËü×Ô¼ºµÄ host ¿é¡£Ã¿Ò»¸öÖÁÉÙÒª¶¨ÒåidÀ´Ö¸¶¨ÐéÄâÖ÷»úµÄÃû×ÖºÍÒ»¸örootÓ¦ÓóÌÐò¡£Ò»¸ö <root-directory>ͨ³£ÓÃÀ´ÎªÖ÷»ú¶¨Ò»¸öĬÈϵÄwebÓ¦ÓóÌÐò¡£
ÅäÖÃÎļþƬ¶Î£º
<server>
<host id='gryffindor.caucho.com'>
<root-directory>/home/www/gryf ......
¾Å´ó¶ÔÏó£º
ÄÚÖöÔÏó£¨ÓÖ½ÐÒþº¬¶ÔÏó£¬ÓÐ9¸öÄÚÖöÔÏó£©:²»ÐèÒªÔ¤ÏÈÉùÃ÷¾Í¿ÉÒÔÔڽű¾´úÂëºÍ±í´ïʽÖÐËæÒâʹÓÃ
1-out:
javax.servlet.jsp.JspWriterÀàÐÍ£¬´ú±íÊä³öÁ÷µÄ¶ÔÏó¡£×÷ÓÃÓòΪpage£¨Ò³ÃæÖ´ÐÐÆÚ£©
request£ºjavax.servlet.ServletRequestµÄ×ÓÀàÐÍ£¬´Ë¶ÔÏó·â×°ÁËÓÉWEBä¯ÀÀÆ÷»òÆäËü¿Í»§¶ËÉú³ÉµØHTTP
ÇëÇóµÄϸ½Ú£¨²ÎÊý ......
1¡¢Ò»¡¢ÏÈÌáÌõ¼þ£º ÔÚweb.xmlÖмÓÒÔÏÂÓï¾ä£¨ÔÒò²Î¿¼RESIN¹Ù·½Îĵµ£©
<servlet>
<servlet-name>SSIServlet</servlet-name>
<servlet-class>com.caucho.servlets.ssi.SS ......