cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jantje <>
Subject Passing parameter from sitemap to .xsp - everything failes - help needed
Date Tue, 12 Sep 2006 12:52:16 GMT

Hi there, after searching a lot of information.. (finding a lot of solutions
- but none of them worked).. I will post my question here:

The file hello.xsp:
<?xml version="1.0"?>

<xsp:page language="java"


    Employee emp = new Employee();
    Date bdate = new Date();
    ObjectContainer db = null;
    String jan = this.parameters.getParameter("habibi", null);
    <title>Hello <xsp:expr>this.parameters.getParameter("habibi",


The file sitemap.xmap:
<?xml version="1.0"?>

<map:sitemap xmlns:map="">
      <map:match pattern="java/*">
        <map:generate src="java/{1}.xsp" type="serverpages">
          <map:parameter name="habibi" value="mylove"/>
          <map:parameter name="servletPath" value="{request:servletPath}"/>
          <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
          <map:parameter name="contextPath" value="{request:contextPath}"/>
          <map:parameter name="file" value="xsp/{1}.xsp"/>
          <map:parameter name="remove" value="{0}"/>

I have made the code very simple, but is works!

In the <title></title> (file: hello.xsp) tags, I can get the sitemap
parameter "habibi".. OK, nice!

But, and this is the problem, in <xsp:logic></xsp:logic> I can not reach the
sitemap parameter "habibi"

At this point, (with the code above) I get this error:
This is when I uncomment:
  //String word = this.parameters.getParameter("habibi", null);
So I do not know what to do?

Yhings I have tryed:
    //passing it as ?name="john" -> request.getParameter failed also!
    //String word=request.getParameter("name");

    //This fails:
    //String lang= parameters.getParameter("identification", ((String)

    //String lang= parameters.getParameter("identification", null);

    try {
      String identification = parameters.getParameter("identification",
    } catch (ParameterException e) {
        // parameter not found - no error

  Does someone see the problew, can someone help me?
  Thanks for you advise and time!!!
  Jan, from Belgium
View this message in context:
Sent from the Cocoon - Users forum at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message