You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Phil <co...@coultard.com> on 2005/05/25 13:02:51 UTC

RE: how to test if a Session context exist from sitemap and sessiontransformer ?

If I understand you correctly when you request a parameter(attribute?) from
the session you get an error and want to know if this is normal?
That depends how you are making the request!

Using xsp you can use:
<xsp-session:get-attribute name="PersonID"/>
If there is no session it won't error - there jst won't be anything there!

In the sitemap you can use:
<map:match type="sessionstate" pattern="*">
	<map:parameter name="attribute-name" value="PersonID"/>
	<map:match pattern="*/*/*" label="debug">  <------ 'protected'
pipeline which requires PersonID to be set to 'pattern' (in this case  a
wildcard)
		...do other stuff
	</map:match>
</map:match>
 that is if you are using the default cocoon sitemap (or a sub sitemap of
it) or you have the matcher sessionstate defined like this:
    <map:matcher logger="sitemap.matcher.sessionstate" name="sessionstate"
src="org.apache.cocoon.matching.WildcardSessionAttributeMatcher">
Within the matchers section of the sitemap (see the default cocoon sitemap
for mor info)

For future posts here may I suggest as it says in the introductory email to
this list that you are more specific about the exact nature of your
question, where possible include a way by which someone can re-create the
error and very importantly include the operating system, serverlet type and
version java version and cocoon version. This will make a reply more likely
and ultimately mean you probably solve your problem faster... Which is what
we all need isn't it!

Hope this helps anyhow

Phil

-----Original Message-----
From: Franck Omrane [mailto:fmo@alfadimag.com] 
Sent: 25 May 2005 11:30
To: users@cocoon.apache.org
Subject: how to test if a Session context exist from sitemap and
sessiontransformer ?




Hi,

if i try to get a param from a session context which doesn't exit i get 
an error .... normal .
but how to test if the context exist  ?
in two ways :

-- from the sitemap to   choose the right pipeline.
-- from the session transformer to create the context if it doesn't exist


thanks for your help


---------------------------------------------------------------------
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


Re: how to test if a Session context exist from sitemap and sessiontransformer ?

Posted by Franck Omrane <fm...@alfadimag.com>.
thanks for your help,
you did answer to my question

Phil a écrit :

>If I understand you correctly when you request a parameter(attribute?) from
>the session you get an error and want to know if this is normal?
>That depends how you are making the request!
>
>Using xsp you can use:
><xsp-session:get-attribute name="PersonID"/>
>If there is no session it won't error - there jst won't be anything there!
>
>In the sitemap you can use:
><map:match type="sessionstate" pattern="*">
>	<map:parameter name="attribute-name" value="PersonID"/>
>	<map:match pattern="*/*/*" label="debug">  <------ 'protected'
>pipeline which requires PersonID to be set to 'pattern' (in this case  a
>wildcard)
>		...do other stuff
>	</map:match>
></map:match>
> that is if you are using the default cocoon sitemap (or a sub sitemap of
>it) or you have the matcher sessionstate defined like this:
>    <map:matcher logger="sitemap.matcher.sessionstate" name="sessionstate"
>src="org.apache.cocoon.matching.WildcardSessionAttributeMatcher">
>Within the matchers section of the sitemap (see the default cocoon sitemap
>for mor info)
>
>For future posts here may I suggest as it says in the introductory email to
>this list that you are more specific about the exact nature of your
>question, where possible include a way by which someone can re-create the
>error and very importantly include the operating system, serverlet type and
>version java version and cocoon version. This will make a reply more likely
>and ultimately mean you probably solve your problem faster... Which is what
>we all need isn't it!
>
>Hope this helps anyhow
>
>Phil
>
>-----Original Message-----
>From: Franck Omrane [mailto:fmo@alfadimag.com] 
>Sent: 25 May 2005 11:30
>To: users@cocoon.apache.org
>Subject: how to test if a Session context exist from sitemap and
>sessiontransformer ?
>
>
>
>
>Hi,
>
>if i try to get a param from a session context which doesn't exit i get 
>an error .... normal .
>but how to test if the context exist  ?
>in two ways :
>
>-- from the sitemap to   choose the right pipeline.
>-- from the session transformer to create the context if it doesn't exist
>
>
>thanks for your help
>
>
>---------------------------------------------------------------------
>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
>
>  
>


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