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 / logicsheet.xsp < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.3 KB  |  73 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: logicsheet.xsp,v 1.2 2004/04/05 12:25:30 antonio Exp $ -->
  19.  
  20. <!-- XSP can be assotiated with the logicsheet using processing
  21.      instruction xml-logicsheet or the xsp:logicsheet element.
  22.      Do not use both methods!
  23.  
  24. <?xml-logicsheet href="logicsheets/hello.xsl"?>
  25.  
  26. -->
  27.  
  28. <xsp:page language="java"
  29.           xmlns:xsp="http://apache.org/xsp"
  30.           xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  31.           xmlns:xsp-hello="http://apache.org/xsp/hello/1.0">
  32.  
  33.   <xsp:logicsheet location="logicsheets/hello.xsl"/>
  34.  
  35.   <!-- Context URL also can be used:
  36.  
  37.   <xsp:logicsheet location="context://samples/xsp/logicsheets/hello.xsl"/>
  38.  
  39.      URL relative to the current sitemap CAN NOT be used, as 
  40.      logicsheet is the global object, shared between all sitemaps.
  41.   -->
  42.  
  43.   <page>
  44.     <title>Greetings Page</title>
  45.     <content>
  46.       <xsp:logic>
  47.         String name = <xsp-request:get-parameter name="name"/>;
  48.         if (name == null) {
  49.           <para>
  50.             <!-- Print default greeting -->
  51.             <xsp-hello:greeting name="Unknown"/>
  52.             <form action="logicsheet">
  53.               Please enter your name: <input name="name"/> <input type="submit"/>
  54.             </form>
  55.           </para>
  56.         } else {
  57.           <para>
  58.             <!-- Override default greeting -->
  59.             <xsp-hello:greeting value="Welcome to this small logicsheet sample">
  60.               <!-- Alternate way of specifying name attribute -->
  61.               <xsp-hello:name><xsp:expr>name</xsp:expr></xsp-hello:name>
  62.             </xsp-hello:greeting>
  63.           </para>
  64.  
  65.           <para>
  66.             This greeting above was created using simple logicsheet.
  67.           </para>
  68.         }
  69.       </xsp:logic>
  70.     </content>
  71.   </page>
  72. </xsp:page>
  73.