1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
<!-- Version: $Id: clean-page.xml,v 1.1.2.3 2001/04/16 17:59:44 dims Exp $ -->
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="page-xsp.xsl" type="text/xsl"?>
<page>
<title>First XSP Page</title>
<author>
<name>Stefano Mazzocchi</name>
<address>stefano@apache.org</address>
</author>
<p>Hi, I'm your first XSP page ever.</p>
<p>I've been requested <count/> times.</p>
<p>The content you are seeing in this page is provided to you
by an XML content producer that was compiled into Java bytecode
and executed at request time. This allows greater flexibility and
ease of use for page programmers without any performance degradation
since all XML parsing and such is precompiled and it's avoided at
request time.</p>
<p>Let's show some useful information with expression evaluation...</p>
<request-data>
<string name="Request method" method="Method"/>
<string name="Request URI" method="RequestURI"/>
<string name="Request protocol" method="Protocol"/>
<string name="Servlet path" method="ServletPath"/>
<string name="Path info" method="PathInfo"/>
<string name="Path translated" method="PathTranslated"/>
<string name="Query string" method="QueryString"/>
<int name="Content length" method="ContentLength"/>
<string name="Content type" method="ContentType"/>
<string name="Server name" method="ServerName"/>
<int name="Server port" method="ServerPort"/>
<string name="Remote user" method="RemoteUser"/>
<string name="Remote address" method="RemoteAddr"/>
<string name="Remote host" method="RemoteHost"/>
<string name="Authorization scheme" method="AuthType"/>
</request-data>
<p>Ok. Now that you know how logic can be transformed into content, let's
add some juice and mix logic with content generation
in a way that allows you to forget about what method is used to generate and
handle the content as XML and concentrate on having your work done.
Note, how XSP don't allow you to explicitly write something on the response
from the logic realm: this is one of the major
differences between XSP and other server pages technologies and allows
further processing of the produced content, as required, for example, by
XSL-transformations.</p>
<request-headers/>
<servlet-parameters/>
<p>All right, the first XSP page is over, but you can see the
dynamically syntax highlighted
<link href="../view-source.xml?filename=clean-page.xml">source of this page</link>
and its <link href="../view-source.xml?filename=page-xsp.xsl">logicsheet</link>
provided to you by another XSP page.</p>
<p>Enjoy XSP!</p>
</page>
|