cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Velychko <v_pe...@ukr.net>
Subject Passing parameters to XSP from sitemap
Date Mon, 05 May 2003 03:24:36 GMT
Hi all,

I am trying to pass parameters to XSP from sitemap.

My sitemap:
<map:match pattern="*/data/**">
  <map:generate type="serverpages" src="data/{2}.xsp">
    <map:parameter name="lang" value="{1}"/>
  </map:generate>
  <map:serialize type="xml"/>
</map:match>

My xsp:
<?xml version="1.0" encoding="windows-1251"?>
<xsp:page language="java" 
                  xmlns:xsp="http://apache.org/xsp" 
                  xmlns:esql="http://apache.org/cocoon/SQL/v2">
<data>
  <xsp:logic>
    String lang = parameters.getParameter("lang");
  </xsp:logic>
  <news>
    <esql:connection>
      <esql:pool>mypooldb</esql:pool>
      <esql:execute-query>
        <esql:query name="news_list">
          select ld.subject, ld.annotation
          from langdocument ld
          where ld.document_id=65
            and ld.language='<xsp:expr>lang</xsp:expr>'
        </esql:query>
        <esql:results>
          <esql:row-results>
            <item>
              <subject><esql:get-string column="subject"/></subject>
              <annotation><esql:get-string column="annotation"/></annotation>
            </item>
          </esql:row-results>
        </esql:results>
        <esql:no-results>No results</esql:no-results>
        <esql:error-results>Errors</esql:error-results>
      </esql:execute-query>
    </esql:connection>
  </news>
</data>
</xsp:page>


When I request the page "http://localhost:8888/myproject/en/data/news" I have the following
error:
org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException:
Error compiling news_xsp:
ERROR 1 (org\apache\cocoon\www\antanta\data\news_xsp.java):
...

this.characters("\n");

// start error (lines 306-306) "Unhandled exception type ParameterException"
String lang = parameters.getParameter("lang");

// end error
String current_id =

(
(XSPRequestHelper.getParameter(objectModel,

...
Line 306, column 0: Unhandled exception type ParameterException

What is wrong?

My environment is the following: tomcat 4.1.18, cocoon 2.1M1, Win XP.

-- 
Best regards,
Peter
mailto:v_peter@ukr.net


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message