SSI 参考 - 2。

原创 2004年07月12日 00:10:00

EchoCommand

The echo SSI command. As extensions, it has the parameters "reqstate" (for echoing Jigsaw request states) and "reqheader" (for echoing request header).Also, it can take the flag "here", whose presence means that the variable is to be interpreted at the deepest request level (in the case of chained internal requests), instead of doing so at the top (external request) level. It inserts the value of a variable in the document.
Parameters:
  • var = a SSI variable
  • reqstate = a Jigsaw request state
  • reqheader = a request header
  • here = a flag
Examples:
<!--#echo var="DOCUMENT_URI" --> display the document uri <!--#echo reqheader="referer" --> display the referer header of the request <!--#echo reqstate="pathinfo" --> display the request state "pahtinfo" 

ExecCommand

the SSI exec command. It inserts the output from a CGI script or a shell command in the document. Note that in the Jigsaw architecture CGI scripts are just another resource class, so that no distinction is made between executing a CGI script or including a file.
Parameters:
  • cmd = the command to execute
Example:
<!--#exec cmd="ls -lsa" --> display the result of the ls command 

FLastModCommand

The standard lastmod SSI command.
Parameters: none
Example:
<!--#flastmod--> 

FSizeCommand

The SSI fsize command. It inserts the size of the unparsed file in the document, according to the current value of the variable sizefmt.See configCommand.
Parameters: none
Example:
<!--#fsize --> 

IncludeCommand

The SSI include command. (CGI scripts can be included, simply by providing a so-called virtual path to a resource with a CgiFrame).
Parameters:
  • file = the file to include
  • virtual = a virtual path
  • ifheader = a request header
  • else = a file
Examples:
<!--#include file="included.html" --> include the file "included.html" in the current file <!--#include ifheader="Referer" file="included.html" else="included2.html" --> if the request has a Referer header then include "included.html" else include "included2.html" 

jdbcCommand

The SSI jdbc command allows you to query a SQL database via JDBC. Combinated with some Control Commands, it allows you to display the content of a database easyly.
Parameters:
  • select = the SQL request
  • url = the database URL
  • driver = the JDBC driver class
  • user = the username
  • password = the password
  • name = the result name
  • column = the column number
  • next = a flag
Example:
<!--#jdbc select="SELECT * FROM services" name="result" driver="com.imaginary.sql.msql.MsqlDriver" url="jdbc:msql://www43.inria.fr:4333/services" --> this is the setup of the command. <!--#jdbc name="result" next="true" --> this command move the pointer to the next line of the result set. <!--#jdbc name="result" column="1" --> display the first column of the current line. <!--#jdbc name="result" column="2" --> display the second column of the current line. <!--#jdbc name="result" column="3" --> display the third column of the current line. 

ServletCommand

The SSI servlet command. Servlet can be executed simply by providing a url path to a servlet class.
Parameters:
  • name = the command identifier
  • code = the servlet URL
  • param = a parameter name
  • value = a parameter value
Example:
 <!--#servlet name="Snoop" param="p1" value="v1" --> <!--#servlet name="Snoop" param="p2" value="v2" --> <!--#servlet name="Snoop" param="p3" value="v3" --> <!--#servlet name="Snoop" code="/servlet/snoop" --> 

Control Commands

CounterCommand

The SSI counter command. Used to do things like cpt = cpt + 1.
Parameters:
  • name = the counter identifier
  • init = the init value
  • incr = the value to add to the counter
  • value = a flag
Example:
<!--#cpt name="cpt1" init="0" --> Initialisation: cpt1 = 0 <!--#cpt name="cpt1" incr="1" --> cpt1 = cpt1 + 1 <!--#cpt name="cpt1" value="true" --> display the current value of cpt1 

ElseCommand

Parameters:
  • name = the if command identifier
Example:
<!--#else name="if2" --> 

EndifCommand

Parameters:
  • name = the if command identifier
Example:
<!--#endif name="if2" --> 

EndloopCommand

Parameters:
  • name = the loop command identifier
Example:
<!--#endloop name="loop2" --> 

ExitloopCommand

Parameters:
  • name = the loop command identifier
  • command = a command name (jdbs, cpt)
  • var = a command identifier
  • equals = a string value
Example:
<!--#exitloop name="loop2" command="cpt" var="cpt1" equals="4" --> 

IfCommand

Parameters:
  • name = the command identifier
  • command = a command name (jdbc, cpt)
  • var = a command identifier
  • equals = a string value
Example:
<!--#if name="if2" command="cpt" var="cpt1" equals="2" --> 

LoopCommand

Parameters:
  • name = the command identifier
Example:
<!--#loop name="loop2" --> 

Example

The following example, display the four first columns of the three first lines of the users database.
 <!--#jdbc name="result2" select="SELECT * FROM users" user="bmahe" password="" url="jdbc:msql://www43.inria.fr:4333/users" driver="com.imaginary.sql.msql.MsqlDriver" --> <table border=2> <!--#cpt name="cpt1" init="0" --> <tr><td><b>Name </td><td><b>Login</td> <td><b>Email</td><td><b>Age </td></tr> <!--#loop name="loop2" --> <!--#jdbc name="result2" next="true" --> <tr> <td> <!--#jdbc name="result2" column="1" --> </td><td> <!--#jdbc name="result2" column="2" --> </td><td> <!--#jdbc name="result2" column="3" --> </td><td> <!--#jdbc name="result2" column="4" --> </td> </tr> <!--#cpt name="cpt1" incr="1" --> <!--#exitloop name="loop2" command="cpt" var="cpt1" equals="3" --> <!--#endloop name="loop2" --> </table> counter value : <!--#cpt name="cpt1" value="true" --> 

The result could be:

Name Login Email Age
Smith ssmith ssmith@example.org 25
lafrim ylafrim lafrim@example.org 25
Teole pteole teole@example.org 27

SSI框架小实例,实现增删改查

struts2+spring+ibatis框架整合的小实例,实现增删改查操作
  • gongye_ye
  • gongye_ye
  • 2014年05月30日 15:04
  • 2729

SSI框架整合

SSI框架整合 开发工具: MyEclipse8.5 框架版本: struts2、spring2.5、ibatis   打开MyEclipse8.5新建一个web project如图: ...
  • dqsweet
  • dqsweet
  • 2012年07月27日 18:37
  • 16168

SSI在php程序中的应用

SSI是将内容发送到浏览器之前,可以使用“服务器端包含 (SSI)”指令将文本、图形或应用程序信息包含到网页中。通过一个非常简单的语句即可调用包含文件,此语句指示 Web服务器将内容插入适当网页...
  • Zhao1234567890123456
  • Zhao1234567890123456
  • 2014年09月03日 23:23
  • 1136

Tomcat之——SSI的配置

1.简介:   SSI全称(Server Side Includes)是在HTML静态页面中使用的指令,当页面在服务端执行的时候是可以进行服务端解析的。这种方式可以让我们在存在的HTML页面里面分块动...
  • l1028386804
  • l1028386804
  • 2016年12月08日 23:36
  • 1869

SSI框架

框架的结构分析:框架结构图(是在网上找到的),我自己感觉相对比较清晰。 我分别解释一下每层所涉及的内容和各个层次之间的交互情况。 顶层表现层,对于java开发而言,主要代表的是jsp和html...
  • u012372850
  • u012372850
  • 2016年04月06日 17:03
  • 590

ssi include 用法

ssi (server side include),将内容发送到浏览器之前,可以使用“服务器端包含 (SSI)”指令将文本、图形或应用程序信息包含到网页中 Include 命令可以把其它文档中的...
  • xiongzhengxiang
  • xiongzhengxiang
  • 2012年08月22日 16:31
  • 924

apache2.2.11开启ssi功能

配置 httpd.conf 文件 去掉 AddType text/html .shtml ,AddOutputFilter INCLUDES .shtml 注释     # Filters all...
  • moqidian
  • moqidian
  • 2014年03月04日 17:28
  • 438

框架搭建-SSI搭建步骤详解版本二

一、框架下载   1、Struts2:http://struts.apache.org/download    2、Spring:http://www.springsource.org/downl...
  • jinbo624
  • jinbo624
  • 2015年12月02日 11:03
  • 1504

【ARM】仅用三个GPIO口实现串行SSI信号读取

关键词:磁编码器AS5040,、ARM通用定时器、SSI接口          本篇文稿主要是探讨一下用ARM上的通用定时器,也就是俗称的GPIO口,读取SSI串行信号的问题。        串行数据...
  • DQ_Lab
  • DQ_Lab
  • 2017年04月08日 12:09
  • 1368

SSI同步串行信号

参考:http://zch2634.blog.163.com/blog/static/7517477620084179322647/ Synchronous Serial Interface--...
  • xzongyuan
  • xzongyuan
  • 2014年05月12日 14:13
  • 1110
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:SSI 参考 - 2。
举报原因:
原因补充:

(最多只允许输入30个字)