cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mats Norén <>
Subject Sitemap + Action + AbstractSitemap
Date Wed, 24 Jan 2001 09:58:52 GMT
I've been trying a couple of times to pass values from an Action back to the
I´ve written a simple dummy class called LoginAction which works like a
selector in many ways.

 public Map act (EntityResolver resolver, Map objectModel, String src,
Parameters par) throws Exception {
 HttpServletRequest req = (HttpServletRequest)
 String name = req.getRemoteUser();
 String uri = "";
 if (name != null)
          uri = par.getParameter("logged_in", "");
          System.out.println("User " + name + " logged in..URI set to: " +
          uri = par.getParameter("not_logged_in", "");
          System.out.println("User " + name + " not logged in..URI set to: " +
     Map tmp = new HashMap(1);
     tmp.put("uri", uri);
     return tmp;

I thought that it returned a java Map back to the sitemap and that it could be
retreived by something like (Giacomos example):

<map:match pattern="subscribe/login.html">
    <map:act type="login">
    <parameter name="logged_in" value="forms.xml"/>
    <parameter name="not_logged_in" value="welcome.xml"/>
        <map:generate src="{uri}"/>

I looked in the substitute function of AbstractSitemap and found that the List
in my particular case (above) is empty.
I also looked at the generated code for the sitemap, and for the life of me, I
can´t see what goes wrong.

View raw message