home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / simple.xsp < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  3.4 KB  |  114 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17.  
  18. <!-- CVS $Id: simple.xsp,v 1.2 2004/04/05 12:25:30 antonio Exp $ -->
  19.  
  20. <xsp:page language="java"
  21.           xmlns:xsp="http://apache.org/xsp"
  22.           xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  23.           xmlns:log="http://apache.org/xsp/log/2.0"
  24.           xmlns:capture="http://apache.org/cocoon/capture/1.0"
  25.           xmlns:input="http://apache.org/cocoon/xsp/input/1.0">
  26.  
  27.   <page>
  28.   <log:logger name="xsp-sample" filename="xsp-sample.log"/>
  29.   <log:debug>Processing the beginning of the page</log:debug>
  30.  
  31.    <title>A Simple XSP Page</title>
  32.  
  33.    <content>
  34.  
  35.    <capture:fragment-variable name="page_part">
  36.      <para>These 2 paragraphs were generated at the start of the XSP, and captured for insertion at the end.</para>
  37.  
  38.      <para>Brought to you by Cocoon at <xsp:expr>new Date()</xsp:expr>.</para>
  39.    </capture:fragment-variable>
  40.  
  41.    <para>Hi there! I'm a simple dynamic page generated by XSP (eXtensible Server Pages).</para>
  42.  
  43.    <para>I was requested as the URI: <b><xsp-request:get-uri as="xml"/></b></para>
  44.  
  45.    <para>The following list was dynamically generated:</para>
  46.  
  47.    <ul>
  48.      <xsp:logic>
  49.        <![CDATA[
  50.        for (int i=0; i<3; i++) {
  51.        ]]>
  52.          <li>
  53.            Item <xsp:expr>i</xsp:expr>
  54.          </li>
  55.        <![CDATA[
  56.        } 
  57.        ]]>
  58.      </xsp:logic>
  59.    </ul>
  60.  
  61.    <xsp:element>
  62.      <xsp:param name="name"><xsp:expr>"P".toLowerCase()</xsp:expr></xsp:param>
  63.      <xsp:attribute name="align">left</xsp:attribute>
  64.      <i>
  65.        This paragraph was dynamically generated by logic embedded in the page
  66.      </i>
  67.    </xsp:element>
  68.  
  69.    <para>
  70.      Request parameter "name" as XML:
  71.      <xsp-request:get-parameter name="name" default="Not provided" as="xml"/>
  72.    </para>
  73.  
  74.    <para>
  75.      Request parameter "name" as String:
  76.      <xsp-request:get-parameter name="name" default="Not provided"/>
  77.    </para>
  78.  
  79.    <para>
  80.      Request parameter "name" as iso-8859-2 encoded String (with servlet
  81.      container encoding iso-8859-1):
  82.      <xsp-request:get-parameter name="name" default="Not provided"
  83.        form-encoding="iso-8859-2" container-encoding="iso-8859-1"/>
  84.    </para>
  85.  
  86.    <xsp-request:get-parameter-values name="name"/>
  87.  
  88.    <xsp-request:get-parameter-names/>
  89.  
  90.    <para>
  91.      Header "user-agent" as XML:
  92.      <xsp-request:get-header name="user-agent" as="xml"/>
  93.    </para>
  94.  
  95.    <para>
  96.      Header "user-agent" as String:
  97.      <xsp-request:get-header name="user-agent"/>
  98.    </para>
  99.    
  100.    <para>
  101.         Access to input modules configured in cocoon.xconf: 
  102.         <input:get-attribute module="cocoon-properties" name="fullname"/>
  103.         <input:get-attribute module="cocoon-properties" name="version"/>
  104.    </para>
  105.         
  106.  
  107.    <xsp-request:get-header-names/>
  108.  
  109.    <xsp:expr>page_part</xsp:expr>
  110.    </content>
  111.    <log:debug>Processing the end of the page</log:debug>
  112.   </page>
  113. </xsp:page>
  114.