param.service in templates changes between versions

16 views
Skip to first unread message

Ian Wright

unread,
Oct 4, 2018, 10:34:40 AM10/4/18
to CAS Community
Hi,

I'm trying to update up custom template and I'm stumbling with param.service

e.g.
in the old version (4.1) as an example
jsp/default/ui/casConfirmView.jsp:    <p><spring:message code="screen.confirmation.message" arguments="${fn:escapeXml(param.service)}${fn:indexOf(param.service, '?') eq -1 ? '?' : '&'}ticket=${serviceTicketId
}" /></p>

so I could construct a link/use javascript in my template like this: 
onclick="document.location.href='mylink?forwardURL=${param.service}'; return false;"

I can't work out the equivalent for 5.3

Many thanks for any help.


Andy Ng

unread,
Oct 8, 2018, 11:30:40 AM10/8/18
to CAS Community
Hi Ian,

I don't have an answer for your question, but since nobody is commenting so I thought I will give it a try :)

CAS 5.3 is using Thymeleaf instead of jsp in CAS 4.x, so you need some changes before making the jsp works again... 

If I am not misunderstanded, param.service in jsp means you want to get the paramter service right (I mean this service "https://www.example.com?service=ST-ASDA11C2KESAFD32")

If true, then you can try something like the following to get the service parameter

You might encounter some problem with Spring Boot not allowing your param.service, in that case this might helps too:

Again, not so familiar with this topic, so my answer are probably off, but hopefully it might give your some idea.

Cheers!
- Andy


Ian Wright

unread,
Oct 9, 2018, 4:23:44 AM10/9/18
to CAS Community
Thanks for the response - those are some interesting posts - I see why (the equivalent of) param.service was removed from the default templates

In the end I've decided to do this using javascript rather than trying to get thymeleaf to work - it's a little uglier, especially if supporting older browsers, but it does work at least for my case
e.g. for newer browsers only
?forwardURL=' + new URLSearchParams(window.location.search).get('service');

Andy Ng

unread,
Oct 9, 2018, 5:38:01 AM10/9/18
to CAS Community
Hi Ian,

> using javascript ... but it does work at least for my case...
Great! 

> ... a little uglier...
Well users are not going to see them, a little bit uglier will be fine I am sure :)

Cheers!
- Andy


Reply all
Reply to author
Forward
0 new messages