syntaxe of variable

26 views
Skip to first unread message

vallee.romain

unread,
Aug 31, 2016, 8:20:20 AM8/31/16
to CAS Community
Hello cas users,

just for know :


we can see

<bean id="longTermSessionTGTExpirationPolicy"
     
class="org.jasig.cas.ticket.support.TimeoutExpirationPolicy"
     
c:timeToKillInMilliSeconds="#{ ${rememberMeDuration:1209600} * 1000 }" />

what # does it mean ? in c:timeToKillInMilliSeconds ?

Best regards

Alex Olson

unread,
Aug 31, 2016, 8:33:56 AM8/31/16
to vallee.romain, CAS Community

--
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To post to this group, send email to cas-...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/6b2a31e7-f7d0-4e91-af07-a321d964d2cf%40apereo.org.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.
--
-- Alex

vallee.romain

unread,
Aug 31, 2016, 9:14:15 AM8/31/16
to CAS Community, vallee...@gmail.com
Hello Mister Olson,
it is for the multiplication ?

Alex Olson

unread,
Aug 31, 2016, 11:19:05 AM8/31/16
to vallee.romain, CAS Community
Yeah it evaluates the multiplication.

We have:
#{ ${rememberMeDuration:1209600} * 1000 }
which tells spring "Hey! Please evaluate this as Spring Expression Language.
Spring dutifully does as asked and begins evaluating.
In this case, we have a multiplication operation between two values. One variable and one constant.
The expression:  ${rememberMeDuration:1209600} says "Use the value of rememberMeDuration  if it exists, otherwise use 1209600".
Assuming there is no value for rememberMeDuration, the expression becomes:

#{ 1209600 * 1000 }"
which kicks out a value of 1209600000.

Which means that the expression you have there without a rememberMeDuration would be equivalent to:

<bean id="longTermSessionTGTExpirationPolicy"
     
class="org.jasig.cas.ticket.support.TimeoutExpirationPolicy"

     
c:timeToKillInMilliSeconds="1209600000" />
 
If you have a value in rememberMeDuration, it would of course use that instead.

--
-- Alex

vallee.romain

unread,
Sep 1, 2016, 3:14:06 AM9/1/16
to CAS Community, vallee...@gmail.com
thank you very much Mister Olson.
i think i wasn't the only too have this question ...

your explanation is so clear !!
Reply all
Reply to author
Forward
0 new messages