You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by jantje <ja...@skynet.be> on 2006/09/12 15:52:42 UTC

RE: Passing parameter from sitemap to .xsp - everything failes - help ne


parameters.getParameter("habibi", null);

gives the same problem as:

this.parameters.getParameter("habibi", null);

Still having this problem:

java.lang.NullPointerException:

Cocoon stacktrace[hide]
Language Exception
context://SBxsp/sitemap.xmap - 22:25	<map:serialize>
context://SBxsp/sitemap.xmap - 15:82	<map:transform>
context://SBxsp/sitemap.xmap - 12:61	<map:generate type="serverpages">
context://sitemap.xmap - 890:66	<map:mount>







Ard Schrijvers wrote:
> 
> 
>> 
>> 
>> 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"
>>           xmlns:xsp="http://apache.org/xsp">
>> 
>>   <xsp:structure>
>>     <xsp:include>java.util.*</xsp:include>
>>     <xsp:include>be.incGEO.*</xsp:include>
>>     <xsp:include>com.db4o.*</xsp:include>
>>   </xsp:structure>
>> 
>>   <xsp:logic>
>>     Employee emp = new Employee();
>>     Date bdate = new Date();
>>     ObjectContainer db = null;
>>     String jan = this.parameters.getParameter("habibi", null);
> 
> What is this? Try parameters.getParameter("habibi", null);
> 
> Regards Ard
> 
>>   </xsp:logic>
>>   <page>
>>     <title>Hello <xsp:expr>this.parameters.getParameter("habibi",
>> null)</xsp:expr></title>
>>   </page>
>> 
>> </xsp:page>
>> 
>> The file sitemap.xmap:
>> <?xml version="1.0"?>
>> 
>> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
>>   <map:pipelines>
>>     <map:pipeline>
>>       <map:match pattern="java/*">
>>         <map:generate src="java/{1}.xsp" type="serverpages">
>>           <map:parameter name="habibi" value="mylove"/>
>> 	</map:generate>
>>         <map:transform
>> src="context://samples/stylesheets/dynamic-page2html.xsl">
>>           <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}"/>
>>         </map:transform>
>>         <map:serialize/>
>>       </map:match>
>>     </map:pipeline>
>>   </map:pipelines>
>> </map:sitemap>
>> 
>> 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:
>>   java.lang.NullPointerException:
>> This is when I uncomment:
>>   //String word = this.parameters.getParameter("habibi", null);
>> So I do not know what to do?
>> 
>> Yhings I have tryed:
>>   <xsp:logic>
>>     //passing it as ?name="john" -> request.getParameter failed also!
>>     //String word=request.getParameter("name");
>> 
>>     //This fails:
>>     //String lang= parameters.getParameter("identification", ((String)
>> parameters.getParameter("identification",""));
>> 
>>     //fails:
>>     //String lang= parameters.getParameter("identification", null);
>> 
>>     /*fails:
>>     try {
>>       String identification = 
>> parameters.getParameter("identification",
>> null);
>>     } catch (ParameterException e) {
>>         // parameter not found - no error
>>       }
>>     */
>>   </xsp:logic>
>> 
>>   Does someone see the problew, can someone help me?
>>   Thanks for you advise and time!!!
>>   
>>   Jan, from Belgium
>> -- 
>> View this message in context: 
> http://www.nabble.com/Passing-parameter-from-sitemap-to-.xsp---everything-failes---help-needed-tf2258700.html#a6265431
> Sent from the Cocoon - Users forum at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Passing-parameter-from-sitemap-to-.xsp---everything-failes---help-needed-tf2258700.html#a6266552
Sent from the Cocoon - Users forum at Nabble.com.


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