cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@informatik.tu-darmstadt.de>
Subject Re: Accessing FormValidatorAction parameters in the sitemap
Date Tue, 23 Sep 2003 08:39:32 GMT
Derek Hohls wrote:
> Chris
>  
> Thanks for the reply - the form validation is used elsewhere
> in the sitemap, as part of user authentication in fact.
> However, I need to access the {username} again for
> display in certain pages.
>  
> Do you know how to access this value?

that sounds like it lives somewhere on the stack of values. without 
knowing more about your sitemap, I can't count the nesting levels for 
the number of "../" in front of "username".

set your logging level for sitemap to debug and you'll find a listing of 
all sitemap variables available at different points of your sitemap.

as an alternative, the action stores all values successful validated or 
not as request attributes. by using the request input module you can 
access it directly. have a look at the source or javadocs to find out 
about the key, it's probably

    <parameter name="username" 
value="{request:attribute/org.apache.cocoon.acting.Validation/username}"/>

or something similar. the request module is jxpath based, not quite sure 
if this is the correct way to invoke the getAttribute() method on the 
request....

>  
> Thanks
> Derek
> 
> On 22.Sep.2003 -- 02:36 PM, Derek Hohls wrote:
> 
>>Working with Cocoon 2.0.4  and JDK 1.3...
>>
>>I am trying to get the value of parameters used in 
>>a FormValidatorAction, to pass as new parameters
>>further on in the sitemap.
>>
>>According to the Cocoon API docs, if I have :
>>
>> <map:act type="form-validator">
>>         <parameter name="descriptor" value="context://descriptor.xml">
>>         <parameter name="validate" value="username,password">
>> </map:act>
>>
>>then:
>>
>>"This action returns null when validation fails, otherwise it provides 
>>all validated parameters to the sitemap via {name} expression."
>>
>>
>>This means, from what I understand of this API, that I should 
>>be able to have:
>>
>>  <map:match pattern="test/*">
>>    <map:generate  type="file" src="test/{1}.xml" />
>>    <map:transform src="styles/page2html.xsl">
>>      <map:parameter name="username" value="{username}" />
>>    </map:transform>
>>    <map:serialize />
>>  </map:match> 
> 
>  
> And where exactly do you use the formvalidator?
>  
> 
>>and expect to access the value of 'username' as parameter
>>in the page2html.xsl transform - however, I always get a null value 
>>returned even when the validation is successful - is the above
>>syntax incorrect?
> 
>  
>  Chris.


-- 

	Christian Haul

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


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


Mime
View raw message