You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by mo...@wipro.com on 2004/05/10 13:18:16 UTC

How to pass request value to generator

Hi,
 
How can we retrieve the parameters sent by a html form and send this as
an input to a generator
 
I have a html page
 
<form name="test" action"TestPage"
< input type=hidden name ="hiddenPath" value="/test">
</form>
 
 
I want to extract the content of hiddenPath variable which has been
submitted as part of the request and pass this value as a input to "src"
of directory tag.
     <map:generate type="directory" src="">
 
So that I can get the listing of a directory sent from the html form.
 
I was thinking of retrieving the value using flowscript and storing in
the session, not sure how to access value from session variable and send
it to <map:generate src attribute.
 
Can any one throw some pointers on how to achieve the same.
 
Thanks in advance.
Regards,
Moin

Re: How to pass request value to generator

Posted by Joerg Heinicke <jo...@gmx.de>.
But have in mind that this solutions has a major security issue when 
setting hiddenPath input to something like ../../../aPath, /aPath or 
file://C:/Windows/aPath. I would recommend at least 
src="context://{request-param:hiddenPath}", so that the path can not be 
outside the servlet context directory. Or using an action testing for 
valid values of hiddenPath.

Joerg

On 10.05.2004 13:28, Johannes Textor wrote:

> Hi,
> 
> you can use the following syntax:
> <map:generate type="directory" src="{request-param:hiddenPath}">
> 
> HTH, Johannes
> moinuddin.ahmed@wipro.com wrote:
> 
>> Hi,
>>  
>> How can we retrieve the parameters sent by a html form and send this 
>> as an input to a generator
>>  
>> I have a html page
>>  
>> <form name="test" action"TestPage"
>> < input type=hidden name ="hiddenPath" value="/test">
>> </form>
>>  
>>  
>> I want to extract the content of hiddenPath variable which has been 
>> submitted as part of the request and pass this value as a input to 
>> "src" of directory tag.
>>      <map:generate type="directory" src="">
>>  
>> So that I can get the listing of a directory sent from the html form.
>>  
>> I was thinking of retrieving the value using flowscript and storing in 
>> the session, not sure how to access value from session variable and 
>> send it to <map:generate src attribute.
>>  
>> Can any one throw some pointers on how to achieve the same.
>>  
>> Thanks in advance.
>> Regards,
>> Moin

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


Re: How to pass request value to generator

Posted by Johannes Textor <jc...@gmx.de>.
Hi,

you can use the following syntax:
<map:generate type="directory" src="{request-param:hiddenPath}">

HTH, Johannes
moinuddin.ahmed@wipro.com wrote:

> Hi,
>  
> How can we retrieve the parameters sent by a html form and send this 
> as an input to a generator
>  
> I have a html page
>  
> <form name="test" action"TestPage"
> < input type=hidden name ="hiddenPath" value="/test">
> </form>
>  
>  
> I want to extract the content of hiddenPath variable which has been 
> submitted as part of the request and pass this value as a input to 
> "src" of directory tag.
>      <map:generate type="directory" src="">
>  
> So that I can get the listing of a directory sent from the html form.
>  
> I was thinking of retrieving the value using flowscript and storing in 
> the session, not sure how to access value from session variable and 
> send it to <map:generate src attribute.
>  
> Can any one throw some pointers on how to achieve the same.
>  
> Thanks in advance.
> Regards,
> Moin



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


AW: How to pass request value to generator

Posted by Nils <co...@lolili.de>.
Hi,

something like:

<map:generate type="directory"
src="{request-param:hiddenpath}/someother/path/value">

should work,

regards,
Nils


-----Ursprüngliche Nachricht-----
Von: moinuddin.ahmed@wipro.com [mailto:moinuddin.ahmed@wipro.com] 
Gesendet: Montag, 10. Mai 2004 13:18
An: users@cocoon.apache.org
Betreff: How to pass request value to generator


Hi,

How can we retrieve the parameters sent by a html form and send this as an
input to a generator

I have a html page

<form name="test" action"TestPage"
< input type=hidden name ="hiddenPath" value="/test">
</form>


I want to extract the content of hiddenPath variable which has been
submitted as part of the request and pass this value as a input to "src" of
directory tag.
     <map:generate type="directory" src="">

So that I can get the listing of a directory sent from the html form.

I was thinking of retrieving the value using flowscript and storing in the
session, not sure how to access value from session variable and send it to
<map:generate src attribute.

Can any one throw some pointers on how to achieve the same.

Thanks in advance.
Regards,
Moin


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