home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0"?>
- <!--
- Copyright 1999-2004 The Apache Software Foundation
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
-
- <!-- CVS $Id: simple.xsp,v 1.2 2004/04/05 12:25:30 antonio Exp $ -->
-
- <xsp:page language="java"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:xsp-request="http://apache.org/xsp/request/2.0"
- xmlns:log="http://apache.org/xsp/log/2.0"
- xmlns:capture="http://apache.org/cocoon/capture/1.0"
- xmlns:input="http://apache.org/cocoon/xsp/input/1.0">
-
- <page>
- <log:logger name="xsp-sample" filename="xsp-sample.log"/>
- <log:debug>Processing the beginning of the page</log:debug>
-
- <title>A Simple XSP Page</title>
-
- <content>
-
- <capture:fragment-variable name="page_part">
- <para>These 2 paragraphs were generated at the start of the XSP, and captured for insertion at the end.</para>
-
- <para>Brought to you by Cocoon at <xsp:expr>new Date()</xsp:expr>.</para>
- </capture:fragment-variable>
-
- <para>Hi there! I'm a simple dynamic page generated by XSP (eXtensible Server Pages).</para>
-
- <para>I was requested as the URI: <b><xsp-request:get-uri as="xml"/></b></para>
-
- <para>The following list was dynamically generated:</para>
-
- <ul>
- <xsp:logic>
- <![CDATA[
- for (int i=0; i<3; i++) {
- ]]>
- <li>
- Item <xsp:expr>i</xsp:expr>
- </li>
- <![CDATA[
- }
- ]]>
- </xsp:logic>
- </ul>
-
- <xsp:element>
- <xsp:param name="name"><xsp:expr>"P".toLowerCase()</xsp:expr></xsp:param>
- <xsp:attribute name="align">left</xsp:attribute>
- <i>
- This paragraph was dynamically generated by logic embedded in the page
- </i>
- </xsp:element>
-
- <para>
- Request parameter "name" as XML:
- <xsp-request:get-parameter name="name" default="Not provided" as="xml"/>
- </para>
-
- <para>
- Request parameter "name" as String:
- <xsp-request:get-parameter name="name" default="Not provided"/>
- </para>
-
- <para>
- Request parameter "name" as iso-8859-2 encoded String (with servlet
- container encoding iso-8859-1):
- <xsp-request:get-parameter name="name" default="Not provided"
- form-encoding="iso-8859-2" container-encoding="iso-8859-1"/>
- </para>
-
- <xsp-request:get-parameter-values name="name"/>
-
- <xsp-request:get-parameter-names/>
-
- <para>
- Header "user-agent" as XML:
- <xsp-request:get-header name="user-agent" as="xml"/>
- </para>
-
- <para>
- Header "user-agent" as String:
- <xsp-request:get-header name="user-agent"/>
- </para>
-
- <para>
- Access to input modules configured in cocoon.xconf:
- <input:get-attribute module="cocoon-properties" name="fullname"/>
- <input:get-attribute module="cocoon-properties" name="version"/>
- </para>
-
-
- <xsp-request:get-header-names/>
-
- <xsp:expr>page_part</xsp:expr>
- </content>
- <log:debug>Processing the end of the page</log:debug>
- </page>
- </xsp:page>
-