Author: vgritsenko Date: Tue Mar 22 06:52:14 2005 New Revision: 158609 URL: http://svn.apache.org/viewcvs?view=rev&rev=158609 Log: add intermediate page to jsp samples. fix views.
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/samples.xml (with props) Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/hello.jsp cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/sitemap.xmap cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/welcome.jsp Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/hello.jsp URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/hello.jsp?view=diff&r1=158608&r2=158609 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/hello.jsp (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/hello.jsp Tue Mar 22 06:52:14 2005 @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> + <%@ page language='java' session='false' %> <page> <title>Hello</title> Added: cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/samples.xml URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/samples.xml?view=auto&rev=158609 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/samples.xml (added) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/samples.xml Tue Mar 22 06:52:14 2005 @@ -0,0 +1,38 @@ +<?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. +--> + +<!--+ + | $Id$ + +--> +<samples name="JSP Block Samples"> + + <group name="Back"> + <sample name="Back" href="../..">to Cocoon Samples main page</sample> + <sample name="Back" href="..">to Cocoon Blocks Samples main page</sample> + </group> + + <group name="JSP Block"> + <note> + JSP Block requires configuration. By default, JSP block + is configured to run with Tomcat Jasper JSP compiler. + </note> + <sample name="Welcome" href="welcome.htm"> + Welcome to JSP samples + </sample> + </group> + +</samples> Propchange: cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/samples.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/samples.xml ------------------------------------------------------------------------------ svn:keywords = Id Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/sitemap.xmap URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/sitemap.xmap?view=diff&r1=158608&r2=158609 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/sitemap.xmap (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/sitemap.xmap Tue Mar 22 06:52:14 2005 @@ -14,46 +14,83 @@ See the License for the specific language governing permissions and limitations under the License. --> + +<!--+ + | $Id$ + +--> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> - <!-- =========================== Components ================================ --> + <!-- ========================== Components =============================== --> <map:components> <map:generators default="file"> - <!-- JspGenerator is used to get result of a JSP page - then output it as XML (SAX events) - --> - <map:generator logger="sitemap.generator.jsp" name="jsp" + <!--+ + | JSPGenerator is used to get output of a JSP page + | and parse as XML SAX events. + +--> + <map:generator name="jsp" + label="content" + logger="sitemap.generator.jsp" src="org.apache.cocoon.generation.JSPGenerator"/> </map:generators> + <map:readers default="resource"> - <!-- JSPReader is used to serve direct output from - a JSP page. Note, that JSP result can be non XML --> - <map:reader logger="sitemap.reader.jsp" name="jsp" + <!--+ + | JSPReader is used to send output of a JSP page + | directly into the response stream. Note, that JSP + | can produce non XML, or even binary, result. + +--> + <map:reader name="jsp" + logger="sitemap.reader.jsp" src="org.apache.cocoon.reading.JSPReader"> - <!-- The configuration for the JSPReader with its default values: + <!--+ + | The configuration for the JSPReader with its default values: <buffer-size>8192</buffer-size> <output-encoding>UTF-8</output-encoding> - --> + +--> </map:reader> </map:readers> </map:components> - <!-- =========================== Pipelines ================================= --> + <!-- =========================== Views =================================== --> + + <map:views> + <map:view from-label="content" name="content"> + <map:serialize type="xml"/> + </map:view> + + <map:view from-label="content" name="pretty-content"> + <map:transform src="context://stylesheets/system/xml2html.xslt"/> + <map:serialize type="html"/> + </map:view> + + <map:view from-position="last" name="links"> + <map:serialize type="links"/> + </map:view> + </map:views> + + <!-- ========================== Pipelines ================================ --> <map:pipelines> <map:pipeline> - <!-- This works only if TreeProcessor is used --> <map:match pattern=""> - <map:redirect-to uri="welcome.htm" /> + <map:redirect-to uri="welcome"/> + </map:match> + + <map:match pattern="welcome"> + <map:generate src="samples.xml"/> + <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl"> + <map:parameter name="contextPath" value="{request:contextPath}"/> + </map:transform> + <map:serialize/> </map:match> <map:match pattern="*.htm"> - <map:read type="jsp" src="{1}.jsp" mime-type="text/html" /> + <map:read type="jsp" src="{1}.jsp" mime-type="text/html"/> </map:match> <!-- Use this to debug your JSPs --> <map:match pattern="*.xml"> <map:generate type="jsp" src="{1}.jsp"/> - <map:serialize type="xml"/> + <map:serialize type="xml" mime-type="text/xml"/> </map:match> <map:match pattern="*.jsp"> @@ -69,5 +106,5 @@ </map:pipeline> </map:pipelines> + </map:sitemap> -<!-- end of file --> Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/welcome.jsp URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/welcome.jsp?view=diff&r1=158608&r2=158609 ============================================================================== --- cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/welcome.jsp (original) +++ cocoon/branches/BRANCH_2_1_X/src/blocks/jsp/samples/welcome.jsp Tue Mar 22 06:52:14 2005 @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> + <%@ page import="java.util.*" %> <% response.setHeader("Expires", "0");