cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eduardo Godoy Vega" <ego...@mail.tekchile.cl>
Subject [C2] What am I doing wrong?
Date Tue, 09 Oct 2001 16:23:00 GMT
Hi...
here is my problem ... I can't pass parameter from Action to XSP ...

Here goes my code ...

this is my sitemap (a part of)
<map:components>
...
<map:actions>
 <map:action name="unveil-it" src="com.unveil.taglib.cocoon.UnveilAction"/>
</map:actions>
...
</map:components>

<map:pipelines>
...
<map:match pattern="process-unveil">
  <map:act type="unveil-it" >
   <map:generate type="serverpages" src="do_unveil.xsp"/>
   <map:transform src="stylesheets/llbean-html.xsl"/>
  </map:act>
  <map:serialize/>
</map:match>

...
</map:pipelines>

my ActionClass is :

public class UnveilAction extends AbstractAction {
private static java.lang.String UNVEIL_INPUT_FIELD = "Question";

public Map act (Redirector redirector,
                  SourceResolver resolver,
                  Map objectModel,
                  String source,
                  Parameters params) {
Request request  = (Request) objectModel.get (Constants.REQUEST_OBJECT);
if (request == null){
         getLogger().debug ("UnveilAction: no request object");
           return null;
}
HashMap sitemapParams = new HashMap();
String sQuestion = request.getParameter(UNVEIL_INPUT_FIELD);
if (sQuestion == null){
       getLogger().debug ("UnveilAction: Question is null");
       return null;
}
sitemapParams.put("result","From Action:"+sQuestion);
request.setAttribute("unveil_result","From Action:"+sQuestion);
return sitemapParams;
}

and my do_unveil.xsp:
<xsp:page languaje="java" xmlns:xsp="http://apache.org/xsp"
xmlns:log="http://apache.org/xsp/log/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<page>
<help>
<para>GET: <xsp-request:get-parameter name="unveil_result"/>.</para>
</help>
</page>
</xsp:page>

BUT unveil_result is always NULL !!


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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